Text of discourse.matplotlib.org › t › cbook-py-in-matplotlib-py3k › 15328 as Styx crawled it on Nov 19, 2026. The page may have changed since. Only its words are kept, without pictures or layout.

Open the live page

cbook.py in matplotlib-py3k - matplotlib-devel - Matplotlib

cbook.py in matplotlib-py3k Development matplotlib-devel _Tobias_Hoppe April 8, 2011, 7:50pm 1 Hi all, grepping matplotlib-py3k from github, configuring, compiling and installing with python3.2 under Ubuntu posed no problems. Firing up python and import matplotlib shows no errors in the first place. Importing pylab brings up errors in cbook.py, namely the call to os.path.walk() in line 1069 which is deprecated since python3.0.

Without a proper replacement for os.path.walk() FontList.cache can’t be generated. Is it just my fault at some point or is it still broken and needs fixing? If it needs fixing I will gladly look into it. What get’s me wondering is that someone managed to get a simple plot out of mpl on python3. Please give me a hint, if I need to work on it. Greetz, Tobi Michael_Droettboom April 8, 2011, 7:06pm 2 Can you provide a traceback?

I think this usage of os.path.walk may have crept back in from a recent merge from master. It didn’t get noticed because it only runs if the user doesn’t already have a font cache file. I don’t have a chance to look at this right now, but it you want to submit a patch to convert this os.path.walk usage to os.walk, that would of course be appreciated. In general, don’t expect the Python 3.x branch to be terribly useful for production work right now… There’s probably lots of sharp edges like this still lingering beneath the surface.

Cheers, Mike ··· http://p.sf.net/sfu/verizon-sfdev [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-devel -- Michael Droettboom Science Software Branch Space Telescope Science Institute Baltimore, Maryland, USA _Tobias_Hoppe April 8, 2011, 8:22pm 3 I didn’t expect anything to be honest. In fact I just wanted to know if this problem is known or not. Before I posted I crawled through earlier revisions of cbook.py on github.

All revisions I found used the ominous os.path.walk(). In the next step I copied an older FontList.cache to the new name and tried reimporting pylab. That gave me an ValueError while unpickling. I attached both tracebacks, without FontList.py3k.cache present and with it. So I will try rewriting this part to get a FontList.py3k.cache using Py3k. Greetz Tobi ··· http://p.sf.net/sfu/verizon-sfdev Matplotlib-devel@…953…ge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel -- Michael Droettboom Science Software Branch Space Telescope Science Institute Baltimore, Maryland, USA http://p.sf.net/sfu/verizon-sfdev [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-devel