"modules" listing fails in python2.5 command prompt

Bug #126318 reported by Paul Manners
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
matplotlib
New
Undecided
Unassigned
matplotlib (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

When python-matplotlib is installed under Feisty, I find that the interactive python2.5 prompt fails when I try help() -> modules.

See the detailed error message below:

help> modules

Please wait a moment while I gather a list of all available modules...

/usr/lib/python2.5/site-packages/apt/__init__.py:18: FutureWarning: apt API not stable yet
  warnings.warn("apt API not stable yet", FutureWarning)
Data Dir: /usr/share/deskbar-applet
Handlers Dir: ['/home/paulm/.gnome2/deskbar-applet/handlers', '/usr/lib/deskbar-applet/handlers']
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/site-packages/site.py", line 351, in __call__

  File "/usr/lib/python2.5/pydoc.py", line 1649, in __call__
    self.interact()
  File "/usr/lib/python2.5/pydoc.py", line 1667, in interact
    self.help(request)
  File "/usr/lib/python2.5/pydoc.py", line 1683, in help
    elif request == 'modules': self.listmodules()
  File "/usr/lib/python2.5/pydoc.py", line 1804, in listmodules
    ModuleScanner().run(callback)
  File "/usr/lib/python2.5/pydoc.py", line 1855, in run
    for importer, modname, ispkg in pkgutil.walk_packages():
  File "/usr/lib/python2.5/pkgutil.py", line 125, in walk_packages
    for item in walk_packages(path, name+'.', onerror):
  File "/usr/lib/python2.5/pkgutil.py", line 125, in walk_packages
    for item in walk_packages(path, name+'.', onerror):
  File "/usr/lib/python2.5/pkgutil.py", line 110, in walk_packages
    __import__(name)
  File "/usr/lib/python2.5/site-packages/matplotlib/enthought/resource/__init__.py", line 2, in <module>
    from resource_manager import ResourceManager
  File "/usr/lib/python2.5/site-packages/matplotlib/enthought/resource/resource_manager.py", line 20, in <module>
    from resource_reference import ImageReference
  File "/usr/lib/python2.5/site-packages/matplotlib/enthought/resource/resource_reference.py", line 11, in <module>
    class ResourceReference(HasTraits):
  File "/usr/lib/python2.5/site-packages/matplotlib/enthought/resource/resource_reference.py", line 20, in ResourceReference
    resource_factory = Instance(ResourceFactory) # ReadOnly
  File "/usr/lib/python2.5/site-packages/matplotlib/enthought/traits/traits.py", line 531, in Instance
    module = stack(1)[1][0].f_globals[ '__name__' ] )
  File "/usr/lib/python2.5/inspect.py", line 885, in stack
    return getouterframes(sys._getframe(1), context)
  File "/usr/lib/python2.5/inspect.py", line 866, in getouterframes
    framelist.append((frame,) + getframeinfo(frame, context))
  File "/usr/lib/python2.5/inspect.py", line 835, in getframeinfo
    raise TypeError('arg is not a frame or traceback object')
TypeError: arg is not a frame or traceback object

Revision history for this message
Mark Kohler (mkohler) wrote :

I can confirm the bug is also present in gutsy. Running "pydoc modules" from bash gives me the same traceback.

Revision history for this message
Morten Kjeldgaard (mok0) wrote :

Merging version 0.91.2 for Intrepid Ibex, I could fix this behaviour by doing three things:

1) export MATPLOTLIBDATA=/usr/share/matplotlib/
2) place the file matplotlib.conf from the sources in /usr/share/matplotlib
3) create a link from /etc/matplotlibrc to /usr/share/matplotlib/

The latter two points are now taken care of in the ii version. As there is no /etc/profile.d in Ubuntu, there is no way for a package to define an environmental variable. Several other packages have this problem.

Changed in matplotlib:
status: New → Confirmed
Revision history for this message
Benjamin Drung (bdrung) wrote :

With matplotlib 0.98.5.3-1ubuntu1 from Ubuntu 9.10 I cannot reproduce this bug. It is working without setting the environmental variable. So I am closing the bug report. If you discover that the bug was not fixed with matplotlib 0.98.5.3-1ubuntu1, please reopen it.

Changed in matplotlib (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.