This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lemburg
Recipients amaury.forgeotdarc, john.weldon, lemburg
Date 2008-12-05.20:51:25
SpamBayes Score 3.8319348e-13
Marked as misclassified No
Message-id <4939944C.3080809@egenix.com>
In-reply-to <1228480089.15.0.0706302083901.issue4540@psf.upfronthosting.co.za>
Content
On 2008-12-05 13:28, Amaury Forgeot d'Arc wrote:
> Amaury Forgeot d'Arc <amauryfa@gmail.com> added the comment:
> 
> Attached patch ignores any Exception during module import.
> Note that KeyboardInterrupt is not caught: it is not an Exception.

Is there a reason why "formatter" is imported inside the method
rather than at module scope ?

Other than that the patch looks good.

> I could provide a similar patch for 2.7, if there is some interest; but
> no crash was reported.

Python 2.6 and 2.7 have the same problem:

help> modules web

Here is a list of matching modules.  Enter any module name to get more help.

...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/python-2.6-ucs2/lib/python2.6/site.py", line 429, in __call__
    return pydoc.help(*args, **kwds)
  File "/usr/local/python-2.6-ucs2/lib/python2.6/pydoc.py", line 1687, in __call__
    self.interact()
  File "/usr/local/python-2.6-ucs2/lib/python2.6/pydoc.py", line 1705, in interact
    self.help(request)
  File "/usr/local/python-2.6-ucs2/lib/python2.6/pydoc.py", line 1723, in help
    self.listmodules(split(request)[1])
  File "/usr/local/python-2.6-ucs2/lib/python2.6/pydoc.py", line 1812, in
listmodules
    apropos(key)
  File "/usr/local/python-2.6-ucs2/lib/python2.6/pydoc.py", line 1912, in apropos
    ModuleScanner().run(callback, key)
  File "/usr/local/python-2.6-ucs2/lib/python2.6/pydoc.py", line 1877, in run
    for importer, modname, ispkg in pkgutil.walk_packages(onerror=onerror):
  File "/usr/local/python-2.6-ucs2/lib/python2.6/pkgutil.py", line 110, in
walk_packages
    __import__(name)
  File "/home/lemburg/lib/DNS/__init__.py", line 13, in <module>
    import Type,Opcode,Status,Class
  File "/home/lemburg/lib/DNS/Type.py", line 67
SyntaxError: Non-ASCII character '\xf6' in file /home/lemburg/lib/DNS/Type.py on
line 67, but no encoding declared; see http://www.python.org/peps/pep-0263.html
for details

(pydoc will look in all modules on sys.path, so chances are high
that users will run into similar problems)
History
Date User Action Args
2008-12-05 20:51:28lemburgsetrecipients: + lemburg, amaury.forgeotdarc, john.weldon
2008-12-05 20:51:27lemburglinkissue4540 messages
2008-12-05 20:51:25lemburgcreate