0

When I try to pull a folder with dulwich, I got this error:

 AttributeError: 'NoneType' object has no attribute 'startswith'

I got the same error on windows or linux. The clone fonction works perfectly

Here is my code:

 from dulwich import porcelain
 import ssl

 depot_maj = "https://github.com/jelmer/dulwich.git"

 #Disable SSL verification for private server
 ssl._create_default_https_context = ssl._create_unverified_context


 #porcelain.clone(depot_maj, "test")
 porcelain.pull("test", depot_maj)

When i change the pull fonction with this:

 porcelain.pull("test", depot_maj, "refs/heads/master")

I got:

 TypeError: startswith first arg must be str or a tuple of str, not bytes

What i'm doing wrong ?

EDIT: Im running Python 3.5

Salamafet
  • 5
  • 4
  • You are probably running under Python 2. At the beginning of the file, add [`from __future__ import unicode_literals`](http://python-future.org/unicode_literals.html) to the beginning of the file and see if the issue goes away. If you are on Python 3, it's probably due to some internal API incomplete migration to Python 3. – metatoaster Aug 31 '16 at 13:29
  • I'm running Python 3 – Salamafet Aug 31 '16 at 18:20
  • Looks like an internal bug in Dulwich as it isn't fully Python 3 compatible. – metatoaster Sep 01 '16 at 01:53
  • Ok thanks. I've created an issue on the repo of Dulwich – Salamafet Sep 01 '16 at 07:28

1 Answers1

0

FWIW this issue is fixed in newer versions of Dulwich.

jelmer
  • 2,405
  • 14
  • 27