[New-bugs-announce] [issue13192] ImportError silences low-level OS errors

Antoine Pitrou report at bugs.python.org
Sun Oct 16 22:25:16 CEST 2011


New submission from Antoine Pitrou <pitrou at free.fr>:

Not sure this is by design or not, but I wanted to report this issue (it's rather hard to diagnose). Here the file descriptor limit is reached, and "import" raises an ImportError while it would be more helpful to let the original OS error slip through (which, here, is EMFILE):

>>> import resource
>>> resource.setrlimit(resource.RLIMIT_NOFILE, (2, 100))
>>> import encodings.idna
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'idna'
>>> resource.setrlimit(resource.RLIMIT_NOFILE, (100, 100))
>>> import encodings.idna
>>>

----------
components: Interpreter Core
messages: 145639
nosy: brett.cannon, ncoghlan, pitrou
priority: normal
severity: normal
status: open
title: ImportError silences low-level OS errors
type: behavior
versions: Python 3.2, Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13192>
_______________________________________


More information about the New-bugs-announce mailing list