eliben / pycparser

:snake: Complete C99 parser in pure Python
Other
3.21k stars 612 forks source link

c_ast.cpython-*.pyc is rewritten after it is installed #542

Open tatsuki-makino opened 3 months ago

tatsuki-makino commented 3 months ago

When using pycparser, pycache/c_ast.cpython-*.pyc may be rewritten to something different than it was at the time it was installed.

I already forgot what I looked into this, but it happens when the path to the file when _run_build_tables is executed is different from the path to the file when the installation is finished and actually used. Also, file rewriting occurs only when the file is executed with the permission to rewrite the file. This rewriting is troublesome in an installation package system that can detect file changes by hash or other.

It seems that this problem can already be solved with PEP 517, but if it is to be solved on the pycparser side it would be better if it were changed like patch.txt