# Show they appropriate object and dump it to a file
status = git.file_from_index(fname)
f = TemporaryFile()
- f.write(status.encode())
+ f.write(status.encode('utf-8'))
verifiers = [ v(ui, opts, base=repo_base) for v in all_verifiers ]
for v in verifiers:
if filter:
cmd += [ "--diff-filter=%s" % filter ]
cmd += [ self.head_revision(), "--" ] + files
- status = subprocess.check_output(cmd).decode().rstrip("\n")
+ status = subprocess.check_output(cmd).decode('utf-8').rstrip("\n")
if status:
return [ f.split("\t") for f in status.split("\n") ]
def file_from_index(self, name):
return subprocess.check_output(
- [ self.git, "show", ":%s" % (name, ) ]).decode()
+ [ self.git, "show", ":%s" % (name, ) ]).decode('utf-8')
def file_from_head(self, name):
return subprocess.check_output(
[ self.git, "show", "%s:%s" % (self.head_revision(), name) ]) \
- .decode()
+ .decode('utf-8')
def detect_repo(path="."):
"""Auto-detect the revision control system used for a source code
for num,line in enumerate(fobj):
if num not in regions:
continue
- s_line = line.decode().rstrip('\n')
+ s_line = line.decode('utf-8').rstrip('\n')
if not self.check_line(s_line, language=lang):
if not silent:
self.ui.write("invalid %s in %s:%d\n" % \
close = True
norm_fname = self.normalize_filename(filename)
- old = [ l.decode().rstrip('\n') for l in fobj ]
+ old = [ l.decode('utf-8').rstrip('\n') for l in fobj ]
if close:
fobj.close()