Marc-Andre Lemburg <[EMAIL PROTECTED]> added the comment:

On 2008-12-05 13:28, Amaury Forgeot d'Arc wrote:
> Amaury Forgeot d'Arc <[EMAIL PROTECTED]> 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)

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue4540>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to