R. David Murray rdmur...@bitdance.com added the comment:
Brett applied his doc patch in r69092. Attached is a patch that combines
Simon's patch with Martin's test program turned into a unit test. I confirm
that the test suite passes with the patch applied (and fails with just the test
Brett Cannon br...@python.org added the comment:
Nothing jumps to my mind.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4236
___
___
R. David Murray rdmur...@bitdance.com added the comment:
Committed to py3k in r87251, 3.1 in r87252, and 2.7 in r87255.
--
resolution: - fixed
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
Simon Cross hodges...@gmail.com added the comment:
I'm attaching a patch to relax the check in PyModule_Create2 as suggested by
the Amaury (http://bugs.python.org/issue4236#msg75409).
The patch uses PyThreadState_Get()-interp-modules == NULL to determine
whether the import machinery has been
Changes by Terry J. Reedy tjre...@udel.edu:
--
versions: -Python 2.6, Python 3.0
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4236
___
___
Alexander Belopolsky belopol...@users.sourceforge.net added the comment:
The bug is still present in 2.7, and 3.2.
--
nosy: +belopolsky
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4236
___
Changes by R. David Murray rdmur...@bitdance.com:
--
components: +Interpreter Core
stage: - needs patch
type: - crash
versions: +Python 2.6, Python 2.7, Python 3.1, Python 3.2
___
Python tracker rep...@bugs.python.org
Changes by Brett Cannon [EMAIL PROTECTED]:
--
assignee: brett.cannon -
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4236
___
___
Python-bugs-list
Martin v. Löwis [EMAIL PROTECTED] added the comment:
Here is a test case (a.py) which produces a FatalError back to Python
2.4 at least)
Added file: http://bugs.python.org/file12073/a.py
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4236
Barry A. Warsaw [EMAIL PROTECTED] added the comment:
After consultation with MvL and Crys_ on irc, we've agreed that this
should be fixed someday but it's a pathological case that shouldn't hold
up the release. I'm lowering to critical because I don't think it
should even hold up the final
Brett Cannon [EMAIL PROTECTED] added the comment:
So if you look at Python/pythonrun.c, there is a comment from Tim Peters
(from r34776) where he explicitly points out that this is possibility
but that it has never been reported before. Oops. =)
--
nosy: +brett.cannon
Brett Cannon [EMAIL PROTECTED] added the comment:
I don't think there is anything to fix here beyond the docs for __del__.
You should never expect anything to be working in __del__, and that
includes the import machinery. It should be bare-bones, not trying to
pull in new code!
I have attached
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:
Christian,
The initial example only works in interactive mode.
To make your script crash, you have to set
__builtins__._ = Crasher()
There are several other places where Crasher() will crash on shutdown:
sys.argv.insert(0,
Changes by Barry A. Warsaw [EMAIL PROTECTED]:
--
priority: deferred blocker - release blocker
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4236
___
Martin v. Löwis [EMAIL PROTECTED] added the comment:
PyModule_Create2 might be new, but the warning certainly is not - for
2.x, it lives in Py_InitModule4. Indeed, I can reproduce the problem
with 2.7a0, replacing the import of warnings with an import of imp.
Christian Heimes [EMAIL PROTECTED] added the comment:
Strange, I can't reproduce the problem with any Python version. Even
py3k doesn't crash with either import imp and import warnings.
$ cat ../issue4236.py
class Crasher(object):
def __del__(self):
print(__del__ called)
Barry A. Warsaw [EMAIL PROTECTED] added the comment:
This seems like a corner case to me. We should fix it before the final
release, but I don't think it's worth holding up 3.0rc2 for it. Deferring.
--
priority: release blocker - deferred blocker
Barry A. Warsaw [EMAIL PROTECTED] added the comment:
Can you add some tests for this problem?
--
nosy: +barry
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4236
___
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:
Setting builtins._=None is not enough.
My example is very simple, but the crash I had initially was during the
deletion of sys.last_tb: the C() object may be stored anywhere.
I agree that the test in PyModule_Create2 is too strong: the
STINNER Victor [EMAIL PROTECTED] added the comment:
The problem occurs in PyImport_Cleanup() on this line:
PyDict_SetItemString(dict, _, Py_None);
So the problem is that _ (special variable in the Python
interpreter) is removed too late, or that a destructor loads a module
when Python is
STINNER Victor [EMAIL PROTECTED] added the comment:
Here is a patch fixing this issue: set builtins._=None at exit.
The new introduced function, PyRun_InteractiveCleanup(), might also be
called at the end of other functions like PyRun_InteractiveOne() or
PyRun_InteractiveOneFlags(). If not,
STINNER Victor [EMAIL PROTECTED] added the comment:
Another solution: just remove the initialization test from
PyModule_Create2(). I don't know if it's a safety test or something
like that.
Added file: http://bugs.python.org/file11915/pymodule_create2.patch
STINNER Victor [EMAIL PROTECTED] added the comment:
Python2 is not affected because the bug comes from PyModule_Create2()
which was introduced in Python3.
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4236
New submission from Amaury Forgeot d'Arc [EMAIL PROTECTED]:
The following interactive session crashes the interpreter on shutdown:
class C:
... def __del__(self):
... import warnings
...
C()
__main__.C object at 0x00C29D58
^Z
Fatal Python error: Interpreter not initialized (version
Christian Heimes [EMAIL PROTECTED] added the comment:
I can reproduce the same output with CTRL+D on Linux.
$ python3.0
Python 3.0rc1+ (py3k:67029M, Oct 26 2008, 23:48:21)
[GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2
Type help, copyright, credits or license for more information.
class C:
...
25 matches
Mail list logo