This is an archive of the discontinued Mercurial Phabricator instance.

tests: write out file using bytes I/O
ClosedPublic

Authored by indygreg on Nov 4 2019, 11:57 PM.

Details

Summary

The encoding of sys.stdout varies between Python versions. So
using a one-liner to write a file from a Unicode string is not
deterministic.

This commit writes out the file using bytes I/O to ensure we
have exactly the bytes we want in the file.

This change fixes a test failure in Python 3.5/3.6.

Diff Detail

Repository
rHG Mercurial
Branch
stable
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

indygreg created this revision.Nov 4 2019, 11:58 PM
pulkit accepted this revision.Nov 5 2019, 4:17 AM
This revision is now accepted and ready to land.Nov 5 2019, 4:17 AM
This revision was automatically updated to reflect the committed changes.