user3715648
user3715648

Reputation: 1588

Passing in a kwarg failing in 2.7

Still learning Python and having a hard time finding an answer to this...

So I have a library that has the following function:

def clone(source, target=None, bare=False, checkout=None,
          errstream=default_bytes_err_stream, outstream=None,
          origin=b"origin", **kwargs)

and i'm calling it like this:

porcelain.clone(repo_url, path, bare, errstream=errstream,
                outstream=outstream, opener=self._dulwich_auth)

which has been working fine on 3.x. I just tried using 2.7 though and am getting

TypeError: clone() got an unexpected keyword argument 'opener'

Why is this happening? I haven't seen anyone mention anything different about kwargs in 3 vs 2, so i'm confused why im only seeing this in 2.7. What should I be doing different?

Upvotes: 1

Views: 47

Answers (1)

Giulio Piancastelli
Giulio Piancastelli

Reputation: 15807

The library is dulwich, an implementation of git in pure Python. I looked at the repository on GitHub and noticed that **kwargs has been added to clone in 0.18.6. So, if for any reason you are using e.g. 0.18.5 on Python 2.7, but you are comparing it with code written for 0.18.6 on Python 3, you are going to see that error.

Upvotes: 1

Related Questions