0
時當我嘗試用拉德威一個文件夾的Python德威錯誤,我得到這個錯誤:拉動
AttributeError: 'NoneType' object has no attribute 'startswith'
我得到了在Windows或Linux的同樣的錯誤。 克隆fonction完美的作品
這裏是我的代碼:
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)
當我改變這種拉fonction:
porcelain.pull("test", depot_maj, "refs/heads/master")
我:
TypeError: startswith first arg must be str or a tuple of str, not bytes
我做錯了嗎?
編輯:進出口運行的Python 3.5
您可能正在Python 2下運行。在文件的開頭,將['from __future__ import unicode_literals'](http://python-future.org/unicode_literals.html)添加到文件的開頭,然後看看如果問題消失。如果您使用的是Python 3,可能是由於某些內部API不完全遷移到Python 3. – metatoaster
我正在運行Python 3 – Salamafet
看起來像Dulwich中的一個內部錯誤,因爲它不完全兼容Python 3。 – metatoaster