( )⚙ D11921 pytype: stop excluding statprof.py

This is an archive of the discontinued Mercurial Phabricator instance.

pytype: stop excluding statprof.py
ClosedPublic

Authored by mharbison72 on Dec 14 2021, 4:11 PM.

Details

Summary

This seems to have worked fine before (at least on Linux). We could just add
suppression comments, but this file already imports from the mercurial package,
which seems to prevent this from running as a standalone program because of the
relative import of pycompat. PyCharm isn't happy either way.

File "/mnt/c/Users/Matt/hg/mercurial/statprof.py", line 501, in display:
    Function TextIO.write was called with the wrong arguments [wrong-arg-types]
         Expected: (self, s: str)
  Actually passed: (self, s: bytes)
Called from (traceback):
  line 1091, in main
File "/mnt/c/Users/Matt/hg/mercurial/statprof.py", line 501, in display:
    Function TextIO.write was called with the wrong arguments [wrong-arg-types]
         Expected: (self, s: str)
  Actually passed: (self, s: bytes)
Called from (traceback):
  line 431, in profile
File "/mnt/c/Users/Matt/hg/mercurial/statprof.py", line 522, in display:
    Function TextIO.write was called with the wrong arguments [wrong-arg-types]
         Expected: (self, s: str)
  Actually passed: (self, s: bytes)
Called from (traceback):
  line 1091, in main
File "/mnt/c/Users/Matt/hg/mercurial/statprof.py", line 522, in display:
    Function TextIO.write was called with the wrong arguments [wrong-arg-types]
         Expected: (self, s: str)
  Actually passed: (self, s: bytes)
Called from (traceback):
  line 431, in profile
File "/mnt/c/Users/Matt/hg/mercurial/statprof.py", line 523, in display:
    Function TextIO.write was called with the wrong arguments [wrong-arg-types]
         Expected: (self, s: str)
  Actually passed: (self, s: bytes)
Called from (traceback):
  line 1091, in main
File "/mnt/c/Users/Matt/hg/mercurial/statprof.py", line 523, in display:
    Function TextIO.write was called with the wrong arguments [wrong-arg-types]
         Expected: (self, s: str)
  Actually passed: (self, s: bytes)
Called from (traceback):
  line 431, in profile
File "/mnt/c/Users/Matt/hg/mercurial/statprof.py", line 524, in display:
    Function TextIO.write was called with the wrong arguments [wrong-arg-types]
         Expected: (self, s: str)
  Actually passed: (self, s: bytes)
Called from (traceback):
  line 1091, in main
File "/mnt/c/Users/Matt/hg/mercurial/statprof.py", line 524, in display:
    Function TextIO.write was called with the wrong arguments [wrong-arg-types]
         Expected: (self, s: str)
  Actually passed: (self, s: bytes)
Called from (traceback):
  line 431, in profile
File "/mnt/c/Users/Matt/hg/mercurial/statprof.py", line 796, in _write:
    Function TextIO.write was called with the wrong arguments [wrong-arg-types]
         Expected: (self, s: str)
  Actually passed: (self, s: bytes)

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.Dec 14 2021, 4:11 PM
Alphare accepted this revision.Dec 15 2021, 5:26 AM
Alphare added a subscriber: Alphare.

This probably also fixes some bug somewhere with stdout buffering

This revision is now accepted and ready to land.Dec 15 2021, 5:26 AM
This revision was automatically updated to reflect the committed changes.