Browse Source

file_like.encoding can be None.

It is specifically if stdout or stderr is just a regular open file, i.e.
open("foo", "w").encoding == None.
Julian Berman 8 years ago
parent
commit
15c8c50e6d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      dulwich/porcelain.py

+ 1 - 1
dulwich/porcelain.py

@@ -585,7 +585,7 @@ def push(repo, remote_location, refspecs=None,
                     refs[rh] = r.refs[lh]
             return refs
 
-        err_encoding = getattr(errstream, 'encoding', 'utf-8')
+        err_encoding = getattr(errstream, 'encoding', None) or 'utf-8'
         remote_location_bytes = remote_location.encode(err_encoding)
         try:
             client.send_pack(path, update_refs,