##// END OF EJS Templates
py3: introduce a wrapper for __builtins__.{raw_,}input()...
py3: introduce a wrapper for __builtins__.{raw_,}input() In order to make this work, we have to wrap the io streams in a TextIOWrapper so that __builtins__.input() can do unicode IO on Python 3. We can't just restore the original (unicode) sys.std* because we might be running a cmdserver, and if we blindly restore sys.* to the original values then we end up breaking the cmdserver. Sadly, TextIOWrapper tries to close the underlying stream during its __del__, so we have to make a sublcass to prevent that. If you see errors like: TypeError: a bytes-like object is required, not 'str' On an input() or print() call on Python 3, the substitution of sys.std* is probably the root cause. A previous version of this change tried to put the bytesinput() method in pycompat - it turns out we need to do some encoding handling, so we have to be in a higher layer that's allowed to use mercurial.encoding.encoding. As a result, this is in util for now, with the TextIOWrapper subclass hiding in encoding.py. I'm not sure of a better place for the time being. Differential Revision: https://phab.mercurial-scm.org/D299

File last commit:

r33837:48f3e87c default
r33838:7d5bc0e5 default
Show More
python3-whitelist
37 lines | 731 B | text/plain | TextLexer
Pulkit Goyal
py3: pass the path in hg.repository() as bytes...
r32894 test-ancestor.py
Pulkit Goyal
py3: update the python3-whitelist with new tests which pass on Python 3...
r33118 test-backwards-remove.t
test-branch-tag-confict.t
test-casecollision.t
test-check-commit.t
Augie Fackler
contrib: check in a whitelist of passing tests in Python 3
r32854 test-check-execute.t
Pulkit Goyal
py3: update the python3-whitelist with new tests which pass on Python 3...
r33118 test-check-pyflakes.t
test-check-pylint.t
Augie Fackler
contrib: check in a whitelist of passing tests in Python 3
r32854 test-check-shbang.t
test-contrib-check-code.t
test-contrib-check-commit.t
Pulkit Goyal
py3: update the python3-whitelist with new tests which pass on Python 3...
r33118 test-diff-issue2761.t
Boris Feld
py3: fix test-diff-newlines.t to be compatible with py3
r33305 test-diff-newlines.t
Pulkit Goyal
py3: update the python3-whitelist with new tests which pass on Python 3...
r33118 test-diff-reverse.t
test-diff-subdir.t
test-dirstate-nonnormalset.t
Augie Fackler
contrib: check in a whitelist of passing tests in Python 3
r32854 test-doctest.py
Augie Fackler
python3: whitelist four more passing tests...
r33837 test-duplicateoptions.py
Pulkit Goyal
py3: update the python3-whitelist with new tests which pass on Python 3...
r33118 test-empty-dir.t
test-excessive-merge.t
Augie Fackler
python3: whitelist four more passing tests...
r33837 test-hghave.t
Pulkit Goyal
py3: update the python3-whitelist with new tests which pass on Python 3...
r33118 test-issue1089.t
test-issue1993.t
test-issue842.t
test-locate.t
Augie Fackler
contrib: check in a whitelist of passing tests in Python 3
r32854 test-lrucachedict.py
Pulkit Goyal
py3: update the python3-whitelist with new tests which pass on Python 3...
r33118 test-manifest.py
Augie Fackler
python3: whitelist four more passing tests...
r33837 test-match.py
Pulkit Goyal
py3: update the python3-whitelist with new tests which pass on Python 3...
r33118 test-merge-default.t
test-merge2.t
test-merge5.t
test-revlog-packentry.t
Augie Fackler
contrib: check in a whitelist of passing tests in Python 3
r32854 test-run-tests.py
Augie Fackler
python3: whitelist four more passing tests...
r33837 test-terse-status.t
Augie Fackler
contrib: check in a whitelist of passing tests in Python 3
r32854 test-unified-test.t
Pulkit Goyal
py3: update the python3-whitelist with new tests which pass on Python 3...
r33118 test-update-reverse.t
Augie Fackler
contrib: check in a whitelist of passing tests in Python 3
r32854 test-xdg.t