Message54902
Logged In: YES
user_id=21627
Exceptions do have structured informations, for example
py> try:
... open("/tmp/xxx")
... except IOError, e:
... print e.__dict__
...
{'errno': 2, 'args': (2, 'No such file or directory'),
'strerror': 'No such file or directory', 'filename': '/tmp/xxx'}
It's just that ImportError doesn't, so I'm retitling this
request to restrict attention to ImportError.
If you have other proposals for specific information that
should be on specific exceptions, please submit a separate
issue.
Would you like to work on this specific problem? I think
ImportError should get a module attribute (always set), and
a filename attribute (set only if a file was selected, yet
failed to import; otherwise set to None). It probably will
require some refactoring of C code to simplify raising
ImportError in the importing code.
Explicit raises of ImportError should also be considered;
those in the standard library should be fixed to include
atleast the module; raising ImportError without giving a
module should set the module to None. |
|
Date |
User |
Action |
Args |
2007-08-23 16:12:08 | admin | link | issue1559549 messages |
2007-08-23 16:12:08 | admin | create | |
|