##// END OF EJS Templates
typing: restore `encoding.encoding` and `encoding.encodingmode` to bytes...
Matt Harbison -
r52566:f70f61a8 default
parent child Browse files
Show More
@@ -103,14 +103,15 b' else:'
103 103 if pycompat.iswindows:
104 104 _encodingrewrites[b'cp65001'] = b'utf-8'
105 105
106 encoding: bytes = b'' # help pytype avoid seeing None value
106 107 try:
107 encoding = environ.get(b"HGENCODING")
108 encoding = environ.get(b"HGENCODING", b'')
108 109 if not encoding:
109 110 encoding = locale.getpreferredencoding().encode('ascii') or b'ascii'
110 111 encoding = _encodingrewrites.get(encoding, encoding)
111 112 except locale.Error:
112 113 encoding = b'ascii'
113 encodingmode = environ.get(b"HGENCODINGMODE", b"strict")
114 encodingmode: bytes = environ.get(b"HGENCODINGMODE", b"strict")
114 115 fallbackencoding = b'ISO-8859-1'
115 116
116 117
General Comments 0
You need to be logged in to leave comments. Login now