Closed spaceone closed 1 year ago
this appears to be a limitation in cpython itself
>>> import ast
>>> contents = open('waf-svn?raw=true', encoding='ISO-8859-1').read()
>>> ast.parse(contents)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.8/ast.py", line 47, in parse
return compile(source, filename, mode, flags,
ValueError: source code string cannot contain null bytes
I suspect the fix here is to also catch ValueError
in places where ast gets parsed and handle that "gracefully" -- in the meantime I'd recommend not linting that file as it appears to be not actual source but a hacked-together binary ?
Yes, I can live with ignoring it (the upstream file is not meant to be changed anymore anytime). But catching the ValueError
in flake8 would save a little time in manually debugging it. Maybe it can just be reported as E999
.
python 3.12 is converting this to a SyntaxError
which will then be handled via the usual pathway -- going to just defer that until that's fixed -- https://github.com/python/cpython/issues/96670
how did you install flake8?
unmodified output of
flake8 --bug-report
describe the problem
what I expected to happen
ISO8859-1
)sample code
https://github.com/univention/univention-corporate-server/blob/5.0-2/services/univention-ldb-modules/buildtools/bin/waf-svn
commands ran