Skip to content

Commit

Permalink
Fix git-p4 decode() missing an assignment
Browse files Browse the repository at this point in the history
bugfix: When using git-p4 in the python2 environment, some places decode() missing an assignment.

Signed-off-by: SaNeOr <sane0r@outlook.com>
  • Loading branch information
SaNeOr committed Mar 2, 2024
1 parent 0f9d4d2 commit 8d4077b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions git-p4.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def metadata_stream_to_writable_bytes(s):
if encodingStrategy == 'passthrough':
return s
try:
s.decode('utf_8')
s = s.decode('utf_8')
return s
except UnicodeDecodeError:
if encodingStrategy == 'fallback' and fallbackEncoding:
Expand Down Expand Up @@ -307,7 +307,7 @@ def decode_path(path):
return path.decode(encoding, errors='replace') if isinstance(path, bytes) else path
else:
try:
path.decode('ascii')
path = path.decode('ascii')
except:
path = path.decode(encoding, errors='replace')
if verbose:
Expand Down Expand Up @@ -3114,7 +3114,7 @@ def writeToGitStream(self, gitMode, relPath, contents):

def encodeWithUTF8(self, path):
try:
path.decode('ascii')
path = path.decode('ascii')
except:
encoding = 'utf8'
if gitConfig('git-p4.pathEncoding'):
Expand Down

0 comments on commit 8d4077b

Please sign in to comment.