2017-03-01 4 views
0

私はgitpythonを使ってファイル処理を行っています。 d.new_file条件を除いて、すべてがうまく動作しています。この型エラーが発生したところで、NoneTypeとstrを連結することはできません。TypeError:GITPYTHONを使用して+: 'NoneType'と 'str'に対応していないオペランドタイプ

私はd.a_pathはNoneだと思いますが、なぜ動作していないのですが、else条件で動作しているのは分かりません。

誰もがd.n_file条件でd.a_pathがNoneである理由を知っていますか?

答えて

1

これはdocumented behaviourです:ファイルがaに存在していなかったので、新しいファイルのパスは、a_pathではない、新しいファイルのb_pathにする必要があります

There are a few cases where None has to be expected as member variable value:

New File:

a_mode is None 
a_blob is None 
a_path is None

Deleted File:

b_mode is None 
b_blob is None 
b_path is None

関連する問題