зеркало из https://github.com/microsoft/git.git
git-p4: open .gitp4-usercache.txt in text mode
Opening .gitp4-usercache.txt in text mode makes python 3 happy without explicitly adding encoding and decoding. Signed-off-by: Yang Zhao <yang.zhao@skyboxlabs.com> Reviewed-by: Ben Keene <seraphire@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Родитель
d38208a297
Коммит
5a5577d808
|
@ -1395,14 +1395,14 @@ class P4UserMap:
|
|||
for (key, val) in self.users.items():
|
||||
s += "%s\t%s\n" % (key.expandtabs(1), val.expandtabs(1))
|
||||
|
||||
open(self.getUserCacheFilename(), "wb").write(s)
|
||||
open(self.getUserCacheFilename(), 'w').write(s)
|
||||
self.userMapFromPerforceServer = True
|
||||
|
||||
def loadUserMapFromCache(self):
|
||||
self.users = {}
|
||||
self.userMapFromPerforceServer = False
|
||||
try:
|
||||
cache = open(self.getUserCacheFilename(), "rb")
|
||||
cache = open(self.getUserCacheFilename(), 'r')
|
||||
lines = cache.readlines()
|
||||
cache.close()
|
||||
for line in lines:
|
||||
|
|
Загрузка…
Ссылка в новой задаче