[issue43662] test_tools: test_reindent_file_with_bad_encoding() fails on s390x RHEL7 LTO + PGO 3.x

STINNER Victor report at bugs.python.org
Mon Mar 29 17:02:59 EDT 2021


STINNER Victor <vstinner at python.org> added the comment:

test_tools.test_reindent_file_with_bad_encoding() runs Tools/scripts/reindent.py.

The check() function of this script calls:

    with open(file, 'rb') as f:
        try:
            encoding, _ = tokenize.detect_encoding(f.readline)
        except SyntaxError as se:
            errprint("%s: SyntaxError: %s" % (file, str(se)))

But I don't think that the buildbot reached this line since the stderr message doesn't start with the input filename. For example, locally, I get the expected error:

$ ./python Tools/scripts/reindent.py -r Lib/test/bad_coding.py; echo $?
Lib/test/bad_coding.py: SyntaxError: unknown encoding for 'Lib/test/bad_coding.py': uft-8
0

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43662>
_______________________________________


More information about the Python-bugs-list mailing list