cbook.py in matplotlib-py3k

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

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


Matplotlib-devel@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/matplotlib-devel

-- Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA

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.nethttps://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


Matplotlib-devel@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/matplotlib-devel