py3: make sure encoding.encoding is a bytes variable
encoding.encoding returns unicodes when locale.getpreferredencoding() is used
to get the preferred encoding. This patch fixes that.
--- a/mercurial/encoding.py Mon Dec 19 22:15:00 2016 +0000
+++ b/mercurial/encoding.py Sat Dec 17 23:55:25 2016 +0530
@@ -93,7 +93,7 @@
try:
encoding = environ.get("HGENCODING")
if not encoding:
- encoding = locale.getpreferredencoding() or 'ascii'
+ encoding = locale.getpreferredencoding().encode('ascii') or 'ascii'
encoding = _encodingfixers.get(encoding, lambda: encoding)()
except locale.Error:
encoding = 'ascii'