( )⚙ D5812 py3: pass str into ValueError to prevent b'' prefix in output

This is an archive of the discontinued Mercurial Phabricator instance.

py3: pass str into ValueError to prevent b'' prefix in output
Needs RevisionPublic

Authored by pulkit on Feb 3 2019, 7:13 AM.

Details

Reviewers
durin42
martinvonz
marmoute
Group Reviewers
hg-reviewers
Summary
  1. skip-blame because mostly just r'' prefixes

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

pulkit created this revision.Feb 3 2019, 7:13 AM
pulkit added a comment.Feb 3 2019, 7:19 AM

I am not whether this is correct. This should have fix failure of test-lfs-serve.t#lfsremote-on failure on py3 but it does not.

yuja added a subscriber: yuja.Feb 3 2019, 7:48 AM
I am not whether this is correct. This should have fix failure of `test-lfs-serve.t#lfsremote-on` failure on py3 but it does not.

As you guess, this isn't correct. For example, _(unicode_sring) will crash
if gettext is enabled.

I don't know why ValueError is used extensively in exchange.py and where it's
supposed to be caught, but the easiest workaround is to make a ValueError
subclass that implements bytes.

class ExchangeValueError(ValueError):
    __bytes__ = _tobytes
marmoute requested changes to this revision.Jan 23 2020, 12:11 PM
marmoute added a subscriber: marmoute.

moving to need revision according to yuya feedback

This revision now requires changes to proceed.Jan 23 2020, 12:11 PM