Bug 603073

Summary: python >>> help() >>> modules command traceback when used without DISPLAY
Product: Red Hat Enterprise Linux 6 Reporter: Petr Muller <pmuller>
Component: pythonAssignee: Dave Malcolm <dmalcolm>
Status: CLOSED ERRATA QA Contact: Petr Šplíchal <psplicha>
Severity: medium Docs Contact:
Priority: low    
Version: 6.1CC: ohudlick
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: python-2.6.6-2.el6 Doc Type: Bug Fix
Doc Text:
The "pydoc -k" command performs a keyword search of the synopses in all installed Python modules. This command failed on modules that did not import, resulting in a traceback. "pydoc -k" now ignores modules that had import exceptions, allowing searches on the remaining modules.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 11:36:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Petr Muller 2010-06-11 13:36:21 UTC
Description of problem:

When testing 526313 over ssh on shared box, I've noticed that 'modules' command in python interactive help probably executes more stuff than necessary, resulting in traceback in the case when no display is available (which is the case of ssh-ing to the box). I also tried to ssh there with -X to see what happens, which results in some gtk (I think) output one would not expect in this context. 


Version-Release number of selected component (if applicable):
python-2.6.2-7.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. ssh <rhel6 box> # I think it should be reproducible even in RHEL6 box in runlevel 3, but I have no such box
2. $ python
3. >>> help()
4. >>> modules abcd
  
Actual results:
help> modules abcd

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/lib/python2.6/site.py", line 429, in __call__
    return pydoc.help(*args, **kwds)
  File "/usr/lib/python2.6/pydoc.py", line 1720, in __call__
    self.interact()
  File "/usr/lib/python2.6/pydoc.py", line 1738, in interact
    self.help(request)
  File "/usr/lib/python2.6/pydoc.py", line 1757, in help
    self.listmodules(split(request)[1])
  File "/usr/lib/python2.6/pydoc.py", line 1862, in listmodules
    apropos(key)
  File "/usr/lib/python2.6/pydoc.py", line 1962, in apropos
    ModuleScanner().run(callback, key)
  File "/usr/lib/python2.6/pydoc.py", line 1927, in run
    for importer, modname, ispkg in pkgutil.walk_packages(onerror=onerror):
  File "/usr/lib/python2.6/pkgutil.py", line 110, in walk_packages
    __import__(name)
  File "/usr/lib/python2.6/site-packages/invest/__init__.py", line 6, in <module>
    import gtk, gtk.gdk, gconf, gobject
  File "/usr/lib/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 64, in <module>
    _init()
  File "/usr/lib/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 52, in _init
    _gtk.init_check()
RuntimeError: could not open display

Expected results:
no traceback

Additional info:
When you *have* a display, you can get something like this, which also does not seem really right: 
** (.:27993): WARNING **: Trying to register gtype 'WnckWindowState' as flags when in fact it is of type 'GEnum'

** (.:27993): WARNING **: Trying to register gtype 'WnckWindowActions' as flags when in fact it is of type 'GEnum'

** (.:27993): WARNING **: Trying to register gtype 'WnckWindowMoveResizeMask' as flags when in fact it is of type 'GEnum'
2010-06-11 09:24:03.982258: ERROR: Could not load the stocks from /root/.gnome2/invest-applet/stocks.pickle: [Errno 2] No such file or directory: '/root/.gnome2/invest-applet/stocks.pickle'

It seems this is more likely an issue of some misbehaving python package, but I've reported it to python because I'm not sure what the help() >>> modules actually executes.

Comment 2 RHEL Program Management 2010-06-11 13:53:00 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 3 RHEL Program Management 2010-07-15 14:51:17 UTC
This issue has been proposed when we are only considering blocker
issues in the current Red Hat Enterprise Linux release. It has
been denied for the current Red Hat Enterprise Linux release.

** If you would still like this issue considered for the current
release, ask your support representative to file as a blocker on
your behalf. Otherwise ask that it be considered for the next
Red Hat Enterprise Linux release. **

Comment 4 Dave Malcolm 2010-07-15 15:09:40 UTC
Sorry for not getting to this earlier.

Looks like bug 461419, which I've fixed in Fedora in python-2.6.5-12.fc14

Comment 9 Laura Bailey 2011-05-09 06:16:26 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
The "pydoc -k" command performs a keyword search of the synopses in all installed Python modules. This command failed on modules that did not import, resulting in a traceback. "pydoc -k" now ignores modules that had import exceptions, allowing searches on the remaining modules.

Comment 10 errata-xmlrpc 2011-05-19 11:36:38 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0554.html

Comment 11 errata-xmlrpc 2011-05-19 13:00:11 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0554.html