Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FilesCheck: Don't fail with mtime in pyc > py #1331

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

danigm
Copy link
Member

@danigm danigm commented Apr 10, 2025

This patch changes the python-bytecode-inconsistent-mtime to do not show if the pyc mtime is later than the source. We are seeing a lot of false positive errors like this building locally with OBS and this will fix the issue.

See https://bugzilla.suse.com/show_bug.cgi?id=1240894

@danigm danigm force-pushed the fix-pyc-mtime-check branch from 7f4fbec to 2fafafd Compare April 10, 2025 06:34
@danigm danigm force-pushed the fix-pyc-mtime-check branch 2 times, most recently from 238eb38 to 96c3ac6 Compare April 10, 2025 07:42
This patch changes the python-bytecode-inconsistent-mtime to do not show if the
pyc mtime is later than the source. We are seeing a lot of false positive
errors like this building locally with OBS and this will fix the issue.

See https://bugzilla.suse.com/show_bug.cgi?id=1240894
@danigm danigm force-pushed the fix-pyc-mtime-check branch from 96c3ac6 to 845d4ab Compare April 10, 2025 07:48
@danigm
Copy link
Member Author

danigm commented Apr 11, 2025

I'm not sure if this is the correct fix. Looks like cpython is checking that the dates are exactly the same, so if we modify this check we can pass packages that will be "wrong" and the interpreter will recreate .pyc files on first import / run.

https://github.com/python/cpython/blob/main/Lib/compileall.py#L236

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant