This is an archive of the discontinued Mercurial Phabricator instance.

progress: use %d to format ints instead of %s
ClosedPublic

Authored by durin42 on Feb 13 2018, 11:13 AM.

Details

Summary

Due to behavioral changes between '% Ns' and '% Nd' this has some
unfortunate extra dancing. I'm not sure of a better way to solve this
problem.

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

durin42 created this revision.Feb 13 2018, 11:13 AM
indygreg accepted this revision.Feb 13 2018, 12:12 PM
indygreg added a subscriber: indygreg.

Ugh. Maybe .format() would be better here. We can use that in 3.5 for bytes, right?

This revision is now accepted and ready to land.Feb 13 2018, 12:12 PM
This revision was automatically updated to reflect the committed changes.

Ugh. Maybe .format() would be better here. We can use that in 3.5 for bytes, right?

Python 3.6.2 (default, Jul 17 2017, 17:35:42)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

b''.format

Traceback (most recent call last):

File "<stdin>", line 1, in <module>

AttributeError: 'bytes' object has no attribute 'format'

Sigh.

yuja added a subscriber: yuja.Feb 14 2018, 7:20 AM

Maybe we want '%d', not '% d'? The latter means to use ' ' in place
of '+' sign.