[PATCH v3] check-code: skip unhandled files

timeless timeless at gmail.com
Wed May 18 15:48:42 EDT 2016


timeless wrote:
> +            with opentext(f) as fp:
> +                header = fp.readline()

This doesn't actually fix the problem I'm hitting w/ py3:

+  Traceback (most recent call last):
+    File "/home/timeless/hg/crew/tests/../contrib/check-code.py",
line 632, in <module>
+      header = fp.readline()
+    File "/home/timeless/hg/py3/lib/python3.5/encodings/ascii.py",
line 26, in decode
+      return codecs.ascii_decode(input, self.errors)[0]
+  UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in
position 949: ordinal not in range(128)

The file in question is CONTRIBUTORS.
And really, this shouldn't be hard to get right, but, boy does python3
make it hard.
There's no reason that I can think of for readline() to go anywhere
near position 949.

fwiw, I've tried using io.open, and it works fine in standalone
testing but breaks in run-tests.


More information about the Mercurial-devel mailing list