[issue12894] pydoc help(modules keyword) is failing when a module throws an exception at the import time

2011-09-04 Thread Christian S. Perone

New submission from Christian S. Perone christian.per...@gmail.com:

Pydoc is failing when running the ModuleScanner().run() when you execute:

help(modules keyword)

... if some module throws an exception at the import time.
See this example:

 help(modules convolve)

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

numpy.numarray.convolve
scipy.fftpack.convolve
Traceback (most recent call last):
  File stdin, line 1, in module
  File C:\Python27\lib\site.py, line 467, in __call__
return pydoc.help(*args, **kwds)
  File C:\Python27\lib\pydoc.py, line 1727, in __call__
self.help(request)
  File C:\Python27\lib\pydoc.py, line 1768, in help
self.listmodules(split(request)[1])
  File C:\Python27\lib\pydoc.py, line 1873, in listmodules
apropos(key)
  File C:\Python27\lib\pydoc.py, line 1975, in apropos
ModuleScanner().run(callback, key)
  File C:\Python27\lib\pydoc.py, line 1938, in run
for importer, modname, ispkg in pkgutil.walk_packages(onerror=onerror):
  File C:\Python27\lib\pkgutil.py, line 125, in walk_packages
for item in walk_packages(path, name+'.', onerror):
  File C:\Python27\lib\pkgutil.py, line 125, in walk_packages
for item in walk_packages(path, name+'.', onerror):
  File C:\Python27\lib\pkgutil.py, line 125, in walk_packages
for item in walk_packages(path, name+'.', onerror):
  File C:\Python27\lib\pkgutil.py, line 125, in walk_packages
for item in walk_packages(path, name+'.', onerror):
  File C:\Python27\lib\pkgutil.py, line 110, in walk_packages
__import__(name)
  File 
C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\lib\pubsub\core\arg1\__init__.py,
 line 16, in module
raise RuntimeError(msg)
RuntimeError: Should not import this directly, used by pubsub.core if applicable

After suppressing the exception by changing the apropos() method inside the 
pydoc.py:

Line:
ModuleScanner().run(callback, key)

To:
ModuleScanner().run(callback, key, onerror=lambda error: error)

The problem is fixed, but I really don't know if this is the best way to 
suppress this and if we should suppress these exceptions, I think that as the 
intent of the help(modules keyword) is to find things with the keyword in the 
name, we shouldn't let the exception be propagated to the user.

--
components: Library (Lib)
messages: 143502
nosy: Christian.S..Perone
priority: normal
severity: normal
status: open
title: pydoc help(modules keyword) is failing when a module throws an 
exception at the import time
type: behavior
versions: Python 2.6, Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12894
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10695] telnetlib.Telnet port number int/str inconsistency

2010-12-14 Thread Christian S. Perone

Christian S. Perone christian.per...@gmail.com added the comment:

I don't know, by doing this on __init__ we can break a lot of legacy codes.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10695
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10695] telnetlib.Telnet port number int/str inconsistency

2010-12-14 Thread Christian S. Perone

Christian S. Perone christian.per...@gmail.com added the comment:

Not from Python itself I think, but external, from users.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10695
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10695] telnetlib.Telnet port number int/str inconsistency

2010-12-14 Thread Christian S. Perone

Christian S. Perone christian.per...@gmail.com added the comment:

Agree.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10695
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10695] telnetlib.Telnet port number int/str inconsistency

2010-12-13 Thread Christian S. Perone

New submission from Christian S. Perone christian.per...@gmail.com:

When you use telnetlib with a str parameter as Port Number:
tel = telnetlib.Telnet(10.0.2.9, 8123)
tel.read_until(login: )

It works fine, except if you set the debuglevel:
tel.set_debuglevel(30)

Then the follow exception is thrown:

Traceback (most recent call last):
  File stdin, line 1, in module
  File c:\python26\lib\telnetlib.py, line 306, in read_until
self.fill_rawq()
  File c:\python26\lib\telnetlib.py, line 517, in fill_rawq
self.msg(recv %r, buf)
  File c:\python26\lib\telnetlib.py, line 239, in msg
print 'Telnet(%s,%d):' % (self.host, self.port),
TypeError: %d format: a number is required, not str

I think that the string Telnet(%s,%d): on the telnetlib.py should be 
Telnet(%s,%s):, since it works fine with a str as Port Number.

--
components: Library (Lib)
messages: 123894
nosy: Christian.S..Perone
priority: normal
severity: normal
status: open
title: telnetlib.Telnet port number int/str inconsistency
type: behavior
versions: Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10695
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Announcing Pyevolve 0.6rc1

2010-04-25 Thread Christian S. Perone
Pyevolve is an evolutionary computation framework written in pure
Python. This is the first  release candidate before the 0.6 official
release.
See more information about this release on the official announce at
(http://pyevolve.sourceforge.net/wordpress/?p=1164) or in the
Documentation site  at (http://pyevolve.sourceforge.net/0_6rc1/).
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


ANN: pyevolve 0.6rc1 released !

2010-04-25 Thread Christian S. Perone
Pyevolve is an evolutionary computation framework written in pure
Python. This is the first  release candidate before the 0.6 official
release.
See more information about this release on the official announce at
(http://pyevolve.sourceforge.net/wordpress/?p=1164) or in the
Documentation site  at (http://pyevolve.sourceforge.net/0_6rc1/).
-- 
http://mail.python.org/mailman/listinfo/python-list