( )⚙ D1557 py3: use encoding.strtolocal() to convert string to bytes

This is an archive of the discontinued Mercurial Phabricator instance.

py3: use encoding.strtolocal() to convert string to bytes
ClosedPublic

Authored by pulkit on Nov 29 2017, 6:09 PM.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

pulkit created this revision.Nov 29 2017, 6:09 PM
yuja requested changes to this revision.Nov 30 2017, 7:28 AM
yuja added a subscriber: yuja.

The result of strftime() has to be converted back to local string
by .encode('ascii') or encoding.strtolocal().

See util.parsedate() for details.

This revision now requires changes to proceed.Nov 30 2017, 7:28 AM
pulkit retitled this revision from py3: use pycompat.bytestr() to convert string to bytes to py3: use encoding.strtolocal() to convert string to bytes.Dec 1 2017, 9:13 AM
pulkit updated this revision to Diff 4050.
yuja requested changes to this revision.Dec 1 2017, 9:59 PM
yuja added inline comments.
mercurial/debugcommands.py
729

timestr may be either bytes or str. strtolocal() should be
applied only to the return value of strftime().

This revision now requires changes to proceed.Dec 1 2017, 9:59 PM
pulkit updated this revision to Diff 4085.Dec 2 2017, 2:51 PM
yuja accepted this revision.Dec 3 2017, 3:54 AM
This revision is now accepted and ready to land.Dec 3 2017, 3:54 AM
This revision was automatically updated to reflect the committed changes.