Comments
Patch
@@ -187,7 +187,7 @@
relinked += 1
savedbytes += sz
except OSError as inst:
- ui.warn('%s: %s\n' % (tgt, str(inst)))
+ ui.warn('%s: %s\n' % (tgt, util.forcebytestr(inst)))
ui.progress(_('relinking'), None)
@@ -449,7 +449,7 @@
except OSError as e:
if e.errno != errno.ENOENT:
ui.warn(_('error removing %s: %s\n') %
- (undovfs.join(undofile), str(e)))
+ (undovfs.join(undofile), util.forcebytestr(e)))
# Remove partial backup only if there were no exceptions
vfs.unlink(chgrpfile)
@@ -723,7 +723,8 @@
try:
os.unlink(undo)
except OSError as inst:
- self.ui.warn(_('error removing undo: %s\n') % str(inst))
+ self.ui.warn(_('error removing undo: %s\n') %
+ util.forcebytestr(inst))
def backup(self, repo, files, copy=False):
# backup local changes in --force case
@@ -147,7 +147,7 @@
# Caller may interrupt the iteration
pickle.dump(None, fp, protocol)
except Exception as inst:
- pickle.dump(str(inst), fp, protocol)
+ pickle.dump(util.forcebytestr(inst), fp, protocol)
else:
pickle.dump(None, fp, protocol)
fp.flush()