[issue22696] Add a function to know about interpreter shutdown
STINNER Victor added the comment: Using the function in the stdlib can be done separately. Is there an open issue for that? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22696 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22696] Add a function to know about interpreter shutdown
Roundup Robot added the comment: New changeset 7f3695701724 by Antoine Pitrou in branch 'default': Issue #22696: Add function :func:`sys.is_finalizing` to know about interpreter shutdown. https://hg.python.org/cpython/rev/7f3695701724 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22696 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22696] Add a function to know about interpreter shutdown
Antoine Pitrou added the comment: Using the function in the stdlib can be done separately. I fixed the typo in the docstring. Thanks! -- resolution: - fixed stage: needs patch - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22696 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22696] Add a function to know about interpreter shutdown
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22696 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22696] Add a function to know about interpreter shutdown
STINNER Victor added the comment: After solving this issue we should reconsider the traceback_ignore_linecache_error.patch patch in issue22599. I reposted the patch in this issue since I just closed the issue #22599. -- Added file: http://bugs.python.org/file37365/traceback_ignore_linecache_error.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22696 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22696] Add a function to know about interpreter shutdown
Antoine Pitrou added the comment: Here is a patch with docs. -- Added file: http://bugs.python.org/file37369/is_finalizing2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22696 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22696] Add a function to know about interpreter shutdown
STINNER Victor added the comment: is_finalizing2.patch looks good to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22696 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22696] Add a function to know about interpreter shutdown
Serhiy Storchaka added the comment: Before committing the patch it will be good to find places in the code which will benefit from this function. And please don't forget to fix a typo in the docstring. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22696 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22696] Add a function to know about interpreter shutdown
STINNER Victor added the comment: Before committing the patch it will be good to find places in the code which will benefit from this function. The traceback and/or the linecache is a first good candidate to use this new function. We may patch more functions later if needed, I don't think that we need to address all issues right now. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22696 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22696] Add a function to know about interpreter shutdown
Serhiy Storchaka added the comment: After solving this issue we should reconsider the traceback_ignore_linecache_error.patch patch in issue22599. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22696 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22696] Add a function to know about interpreter shutdown
Serhiy Storchaka added the comment: An indirect way how to know about interpreter shutdown -- test existing of the path attribute in sys (issue20603). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22696 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22696] Add a function to know about interpreter shutdown
Serhiy Storchaka added the comment: I'm +0 for is_finalizing. There is a typo in the docstring. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22696 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22696] Add a function to know about interpreter shutdown
New submission from Antoine Pitrou: I propose to add a new function sys.shutting_down() (name debatable) returning True if the interpreter is currently shutting down. This would be a function so that you can bind it and avoid having it wiped at shutdown :-) -- components: Interpreter Core messages: 229817 nosy: haypo, pitrou, serhiy.storchaka priority: normal severity: normal stage: needs patch status: open title: Add a function to know about interpreter shutdown type: enhancement versions: Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22696 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22696] Add a function to know about interpreter shutdown
STINNER Victor added the comment: For the issue #22599, I wrote a patch but then I removed my patch and reverted my changed... Here is a new patch which implements why I already wrote: add a new sys._is_finalizing() function, with a unit test. I propose to add a new function sys.shutting_down() (name debatable) The name sounds like a function to shut down the computer or exit Python. I don't like _is_finalizing() name neither :-) My patch uses a private function which is CPython specific. Does it make sense to add a public function instead? Is it possible to implement it in any Python implementation (PyPy, IronPython, Jython, etC.)? I guess that the most dummy implementation is to always return False (Python is always running. -- keywords: +patch Added file: http://bugs.python.org/file36992/is_finalizing.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22696 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22696] Add a function to know about interpreter shutdown
Serhiy Storchaka added the comment: Are there other special interpreter states about which it would by helpful to know? Interpreter initializing, garbage collecting, signal handling? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22696 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22696] Add a function to know about interpreter shutdown
Antoine Pitrou added the comment: My patch uses a private function which is CPython specific. Does it make sense to add a public function instead? I would like it to be public. It can be useful in __del__ methods and the like. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22696 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22696] Add a function to know about interpreter shutdown
Antoine Pitrou added the comment: Are there other special interpreter states about which it would by helpful to know? Interpreter initializing, garbage collecting, signal handling? - interpreter initializing: user code generally isn't executed in that phase - garbage collecting: there are already garbage collection callbacks - signal handling: well... I don't see why that would be useful -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22696 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com