diff options
author | wangweichen <weichen.wang@jsxfedu.com> | 2017-07-13 14:34:09 +0800 |
---|---|---|
committer | wangweichen <weichen.wang@jsxfedu.com> | 2017-07-13 14:34:09 +0800 |
commit | 5e0fea5f6b9e47f52d045d0449dd1a09943496a0 (patch) | |
tree | c51ba1668003a66d505ca263e0fc4eb6a2c50903 | |
parent | 3add9cea092514a82931108bbc05a15355900a52 (diff) | |
download | gitdb-5e0fea5f6b9e47f52d045d0449dd1a09943496a0.tar.gz |
change codecs to open with support 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 84f9f6c..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', encoding="utf-8") 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 |