Bug 526402

Summary: "pydoc -k" searches fail when run as non-root when parted module is installed
Product: [Fedora] Fedora Reporter: Matěj Cepl <mcepl>
Component: pypartedAssignee: David Cantrell <dcantrell>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: dcantrell, hdegoede, ivazqueznet, james.antill, jonathansteffan, mcepl
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: abrt_hash:6d4b909e
Fixed In Version: pyparted-2.3-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 649707 (view as bug list) Environment:
Last Closed: 2010-11-04 15:15:37 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:
Bug Depends On:    
Bug Blocks: 649707    
Attachments:
Description Flags
File: backtrace none

Description Matěj Cepl 2009-09-30 05:44:03 UTC
abrt detected a crash.


How to reproduce
-----
1.
2.
3.


Comment
-----
I don't know why pydoc on the command line needs gopher. Seems bizzare.

Additional information
======


Attached files
----
backtrace

cmdline
-----
/usr/bin/python2.6 /usr/bin/pydoc -k hmac 


component
-----
python


executable
-----
/usr/bin/pydoc


kernel
-----
2.6.31.1-48.fc12.x86_64


package
-----
python-2.6.2-2.fc12


uuid
-----
6d4b909e

Comment 1 Matěj Cepl 2009-09-30 05:44:06 UTC
Created attachment 363123 [details]
File: backtrace

Comment 2 Dave Malcolm 2009-10-12 23:11:48 UTC
"pydoc -k" is searching through all modules on your system.

It's failing on "/home/matej/.python-lib/mechanize/_useragent.py", which looks like a locally-installed version of the mechanize package.  What version of mechanize is that?

Comment 3 Matěj Cepl 2009-10-13 07:34:10 UTC
Yes, that's it. Sorry for the noise.

Comment 4 Matěj Cepl 2009-10-13 07:36:40 UTC
Well, that was hasty:

bradford:~$ pydoc -k hmac
hmac - HMAC (Keyed-Hashing for Message Authentication) Python module.
Crypto.Hash.HMAC - HMAC (Keyed-Hashing for Message Authentication) Python module.

(process:6115): Gdk-CRITICAL **: gdk_keymap_get_for_display: assertion `GDK_IS_DISPLAY (display)' failed

(process:6115): Gdk-CRITICAL **: gdk_screen_get_root_window: assertion `GDK_IS_SCREEN (screen)' failed

** (process:6115): CRITICAL **: egg_keymap_resolve_virtual_modifiers: assertion `GDK_IS_KEYMAP (keymap)' failed

** (process:6115): CRITICAL **: egg_keymap_resolve_virtual_modifiers: assertion `GDK_IS_KEYMAP (keymap)' failed

** (process:6115): CRITICAL **: egg_keymap_resolve_virtual_modifiers: assertion `GDK_IS_KEYMAP (keymap)' failed
Traceback (most recent call last):
  File "/usr/bin/pydoc", line 5, in <module>
    pydoc.cli()
  File "/usr/lib64/python2.6/pydoc.py", line 2264, in cli
    apropos(val)
  File "/usr/lib64/python2.6/pydoc.py", line 1962, in apropos
    ModuleScanner().run(callback, key)
  File "/usr/lib64/python2.6/pydoc.py", line 1927, in run
    for importer, modname, ispkg in pkgutil.walk_packages(onerror=onerror):
  File "/usr/lib64/python2.6/pkgutil.py", line 110, in walk_packages
    __import__(name)
  File "/usr/lib64/python2.6/site-packages/parted/__init__.py", line 28, in <module>
    from _ped import AlignmentException
RuntimeError: pyparted requires root access
bradford:~$ 

Even when I have no local python library, pydoc fails .... Why in the world it needs parted???

Comment 5 Dave Malcolm 2009-10-13 15:56:06 UTC
Well, it's iterating through all installed packages, importing them.  One of the installed packages is "parted", and parted appears to have a hard requirement on being _imported_ as root.

Looks to me like the parted code should be importable as non-root, but only runnable by root.  Alternatively, perhaps "pydoc -k" could be made to handle this kind of case.

Renaming and reasssiging to "parted".  If it's not feasible to fix there, reassign back to python and I can look at a better onerror handler.

Comment 6 Hans de Goede 2009-11-03 13:06:30 UTC
This is not an issue with parted, but with pyparted.

Re-assigning.

David, this is an issue for running pylint on anaconda to (it needs to be done as root because of the root check in pyparted). Since parted itself can be used
as normal user too (on disk images for example), can you please remove the unneeded root check from pyparted ?

Comment 7 David Cantrell 2009-11-07 01:22:02 UTC
(In reply to comment #6)
> This is not an issue with parted, but with pyparted.
> 
> Re-assigning.
> 
> David, this is an issue for running pylint on anaconda to (it needs to be done
> as root because of the root check in pyparted). Since parted itself can be used
> as normal user too (on disk images for example), can you please remove the
> unneeded root check from pyparted ?  

Sure, done and done.  Fixed in pyparted-2.3-1 in rawhide.

Comment 8 Bug Zapper 2009-11-16 13:06:48 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 9 Bug Zapper 2010-11-04 09:44:42 UTC
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '12'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 12's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 12 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping