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
sys.flags and sys.float_info disappear at shutdown #64801
Comments
For some reason they are wiped to fix so-called reference leaks: This changeset is one of the culprits of the problems in bpo-19255. |
I don't understand this bug report. Can you elaborate? What is the current behaviour? What is the expected behaviour? |
The behaviour is explained in the subject line and in the linked changeset: for some reason sys.flags and sys.float_info are explicitly wiped during shutdown. But those are simple immutable objects, there is no reason to wipe them. The expected behaviour is, of course, that those objects keep their proper value during shutdown (e.g. when looked up from destructors). |
sys_at_exit.py: script to reproduce the issue. The changeset 9639a73afa47 explicitly added sys.flags and sys.float_info to sys_deletes, list of symbols that must be cleared at exit. So if I understand correctly the issue, the question is why the change was made. Antoine wants to keep these symbols alive during Python shutdown. |
@antoine: Can you maybe propose a patch to fix this issue? I see that you selected Python 3.4 & 3.5. Why Python 3.4 and not 2.7? (Maybe fixing Python 3.5 is enough?) |
I really don't care about 2.7 for minor fixes is the reason why :-) |
This behaviour is present in 2.7. |
Ping. |
Honestly, I'm not sure that this issue is really a major bug. I don't think that it's worth it to backport the change. It's more a subtle change in Python finalization which is super fragile code. I prefer to only change the master branch, so I close the issue. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: