D3633: py3: use bytes in tests/printenv.py

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Mon May 21 18:29:10 UTC 2018


indygreg accepted this revision.
indygreg added a comment.
This revision is now accepted and ready to land.


  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.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3633

To: pulkit, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel


More information about the Mercurial-devel mailing list