examples directory variable set incorrectly

Bug #1073443 reported by Mark
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
matplotlib (Debian)
Fix Released
Unknown
matplotlib (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

[python-matplotlib version 1.1.1-1]
Some of the examples posted on the matplotlib website fail because they can't find the example data.

In python the examples.directory variable mistakenly includes /etc' '.

mark@Obsidian:~$ python
Python 2.7.3 (default, Sep 26 2012, 21:51:14)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from matplotlib import rcParams
>>> rcParams['examples.directory']
"/etc/'/usr/share/matplotlib/sampledata'"

that is strange however because it's not set up that way in the global configuration file

mark@Obsidian:~$ tail -2 /etc/matplotlibrc
examples.download : False # False to bypass downloading mechanism
examples.directory : '/usr/share/matplotlib/sampledata' # absolute directory to look in if download is false

I don't understand that much about python at the moment so I can't diagnose this any further, but there you have it.

Revision history for this message
WeatherGod (ben-v-root) wrote :

What does the following code return for you?

>>> import matplotlib
>>> print matplotlib.matplotlib_fname()

Changed in matplotlib (Ubuntu):
status: New → Incomplete
Julian Taylor (jtaylor)
Changed in matplotlib (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Mark (nanite) wrote :

WeatherGod, this is the result:

>>> import matplotlib
>>> print matplotlib.matplotlib_fname()
/etc/matplotlibrc

Revision history for this message
Julian Taylor (jtaylor) wrote :

you can fix it by removing the quotes from examples.directory in /etc/matplotlibrc

the etc is coming from matplotlib/__init__.py 776 when the configured path is not found (due to the quotes)

Changed in matplotlib (Debian):
status: Unknown → New
Revision history for this message
Mark (nanite) wrote :

Great, that indeed works. Thanks for finding the problem and pushing it upstream.

Revision history for this message
Julian Taylor (jtaylor) wrote :

This bug was fixed in the package matplotlib - 1.2.0-1

---------------
matplotlib (1.2.0-1) experimental; urgency=low

  * New upstream release
  * debian/{control, rules}
    - run tests for python3 module
  * debian/{control, README.debian}
    - add several missing dependencies (and b-d) for Matplotlib backends
  * debian/rules
    - no longer set examples.* options in matplotlibrc when building doc (they
      are not needed with 1.2.0)
  * debian/patches/60_bts691960_reintroduce_examples.directory_rcparam.patch
    - reintroduce (removed in 1.2.x series) 'examples.directory' rc parameter,
      in order to specify the Debian custom sample_data path; thanks to Julian
      Taylor for the report; Closes: #691960

 -- Sandro Tosi <email address hidden> Sun, 11 Nov 2012 12:17:37 +0100

matplotlib (1.2.0~rc2-2) experimental; urgency=low

  * debian/{control, rules}
    - provide Python 3 packages, based on the work of Thomas Kluyver (thanks!);
      thanks to Yaroslav Halchenko for the report; Closes: #669272

 -- Sandro Tosi <email address hidden> Tue, 23 Oct 2012 22:55:15 +0200

matplotlib (1.2.0~rc2-1) experimental; urgency=low

  * New upstream release candidate
  * debian/control
    - updated Homepage field to new upstream website location
  * debian/copyright
    - converted to DEP-5 format
    - updated to new upstream code
    - extended packaging copyright years
  * debian/patches/60_new_syntax_to_load_searchindex.patch
    - removed, merged upstream
  * debian/watch
    - updated to point to github
  * debian/patches/30_disable_sample_downloads.patch
    - removed, no longer needed
  * debian/patches/10_build_fix.patch
    - disabled, but not removed in case we'll have to restore it
  * debian/python-matplotlib-data.install
    - install sampledata from new location (now it's in upstream tarball)
    - use matplotlibrc.template to install base matplotlib.conf file
  * debian/rules
    - set backend and not datapath in matplotlibrc when running tests
    - fix broken symlinks to TrueType fonts; thanks to Ian Zimmerman for the
      report; Closes: #687674
  * debian/{control, rules}
    - run tests under 'xvfb-run', needed to run inkscape (which is required to
      compare SVG images); adding relevant b-d (xvfb and xauth)

 -- Sandro Tosi <email address hidden> Tue, 25 Sep 2012 19:44:06 +0200

Changed in matplotlib (Ubuntu):
status: Confirmed → Fix Released
Changed in matplotlib (Debian):
status: New → 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.