summaryrefslogtreecommitdiff
path: root/git-p4.py
diff options
context:
space:
mode:
authorYang Zhao <yang.zhao@skyboxlabs.com>2019-12-13 15:52:41 -0800
committerJunio C Hamano <gitster@pobox.com>2020-01-15 12:53:40 -0800
commit5a5577d808668a7859c5009ddfa18b097368ba2c (patch)
treec3775b0bd73282e23af9544aa58a99d13d2fa356 /git-p4.py
parentd38208a297e76bbfbfa8e485632c217aaafa9486 (diff)
downloadgit-5a5577d808668a7859c5009ddfa18b097368ba2c.tar.gz
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>
Diffstat (limited to 'git-p4.py')
-rwxr-xr-xgit-p4.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/git-p4.py b/git-p4.py
index d43f373b2d..abcda60eee 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -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: