diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2017-09-28 10:43:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-28 10:43:49 +0200 |
commit | 7f216d9c8954182e978046384e5491840f936216 (patch) | |
tree | c51ba1668003a66d505ca263e0fc4eb6a2c50903 | |
parent | 4ddd1a3f020c4ed7ee4f281955d31630c716c186 (diff) | |
parent | 5e0fea5f6b9e47f52d045d0449dd1a09943496a0 (diff) | |
download | gitdb-7f216d9c8954182e978046384e5491840f936216.tar.gz |
Merge pull request #41 from nooperpudd/master
support open encoding `utf-8`
-rw-r--r-- | gitdb/db/ref.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gitdb/db/ref.py b/gitdb/db/ref.py index 2e3db86..94a2f01 100644 --- a/gitdb/db/ref.py +++ b/gitdb/db/ref.py @@ -2,6 +2,7 @@ # # This module is part of GitDB and is released under # the New BSD License: http://www.opensource.org/licenses/bsd-license.php +import codecs from gitdb.db.base import ( CompoundDB, ) @@ -41,7 +42,7 @@ class ReferenceDB(CompoundDB): # try to get as many as possible, don't fail if some are unavailable ref_paths = list() try: - with open(self._ref_file, 'r') as f: + with codecs.open(self._ref_file, 'r', encoding="utf-8") as f: ref_paths = [l.strip() for l in f] except (OSError, IOError): pass |