This patch add b'' prefixes and adds some .encode() calls to convert str to
bytes on Python 3.
Details
Details
- Reviewers
indygreg - Group Reviewers
hg-reviewers - Commits
- rHGbacbe829c2bf: py3: use bytes in tests/printenv.py
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Comment Actions
This one worries me a bit because environment variable values can contain non-ASCII. However, the changed code only operates on HG_ variables and I think those variables are well-sanitized and should be ASCII safe.
Also, os.environ is str/bytes on Python 2 and the .encode() is nonsensical. But Python 2 doesn't care, so meh.
Since this is testing code, the barrier for change is low. And the failure mode is pretty obvious. So I'm OK landing this now and fixing later if it causes problems.
Comment Actions
Looks like this needs to be dropped because due to this couple of tests which were already passing failed. Link to buildbot: https://buildbot.mercurial-scm.org/builders/py3%20tests/builds/920/steps/run-tests.py%20%28python3%29/logs/stdio