Page MenuHomePhabricator

verify: convert an exception to bytes before logging
ClosedPublic

Authored by mharbison72 on Mar 12 2021, 1:09 PM.

Details

Summary

I'm not entirely sure why this code appears to be trying to convert twice, but
it was flagged by pytype:

File "/mnt/c/Users/Matt/hg/mercurial/verify.py", line 84, in _exc: Function _bytestr.__init__ was called with the wrong arguments [wrong-arg-types]
         Expected: (self, ints: Iterable[int])
  Actually passed: (self, ints: Exception)
  The following methods aren't implemented on Exception:
  __iter__

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

mharbison72 created this revision.Mar 12 2021, 1:09 PM
mharbison72 added inline comments.Mar 12 2021, 1:14 PM
mercurial/verify.py
88–89

Was this a logic error? I've not seen this pattern in other places. Everything I've seen assumes pycompat.bytestr() returns something.

pulkit added a subscriber: pulkit.Mar 12 2021, 1:21 PM
pulkit added inline comments.
mercurial/verify.py
88–89

Does seems like so.

mharbison72 added inline comments.Mar 16 2021, 6:05 PM
mercurial/verify.py
88–89

Are you waiting for me to fix this? I figured I'd wait until this lands on stable, and then fix it on default since it never runs.

This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.