ソースを参照

Fix encoding.

Jelmer Vernooij 6 年 前
コミット
9599545b54
1 ファイル変更6 行追加2 行削除
  1. 6 2
      dulwich/repo.py

+ 6 - 2
dulwich/repo.py

@@ -168,9 +168,13 @@ def get_user_identity(config, kind=None):
             email = None
     default_user, default_email = _get_default_identity()
     if user is None:
-        user = default_user.encode('utf-8')
+        user = default_user
+        if not isinstance(user, bytes):
+            user = user.encode('utf-8')
     if email is None:
-        email = default_email.encode('utf-8')
+        email = default_email
+        if not isinstance(email, bytes):
+            email = email.encode('utf-8')
     return (user + b" <" + email + b">")