[issue10642] site.py crashes on python startup due to defective .pth file
report at bugs.python.org
Sat Dec 11 03:50:38 CET 2010
STINNER Victor <victor.stinner at haypocalc.com> added the comment:
Yes, I patched the C code to not clear exceptions anymore at startup: r78826 (issue #3137). But this issue is different: here the bug is in the 3rd party module (loaded by site.py), not in Python, and Donald proposes to *ignore* errors (where I did the opposite).
> This places python at the mercy of bugs in third-party software.
Why do you consider this as a bug? Yes, Python allows to be extended by 3rd party softwares. And if you install bogus extensions, you break your Python setup.
Ignore errors is never a good idea. How would you notice that the extension is disabled because it is bogus? I prefer explicit errors to force the user to fix its setup.
Extract of the Gentoo issue:
<< The direct cause of your problem is that you manually created
/usr/lib64/python2.7/site-packages/zope/__init__.py file. Please remove it: rm -f /usr/lib64/python2.7/site-packages/zope/__init__.py* >>
I close this issue because I think that ignore errors is not a good idea.
If you disagree, you can still comment this issue, or reopen it.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list