That fixes it on my machine.
Except that the function GetRealpathAndStat is in cbook.py (I don't even
have a mplutil.py file).
Thanks,
Mark

On Tue, May 13, 2008 at 7:21 PM, Michael Droettboom <[EMAIL PROTECTED]> wrote:

> I suspect on Windows it is safe enough (in most cases) to use the realpath
> as the key, in lieu of anything better.  But that would require testing on
> Windows to make sure.  Can you try replacing the GetRealpathAndStat in
> mplutil.py with the following?
>
> class GetRealpathAndStat:
>  def __init__(self):
>      self._cache = {}
>
>  def __call__(self, path):
>      result = self._cache.get(path)
>      if result is None:
>          realpath = os.path.realpath(path)
>          if sys.platform == "win32":
>              stat_key = realpath
>          else:
>              stat = os.stat(realpath)
>              stat_key = (stat.st_ino, stat.st_dev)
>          result = realpath, stat_key
>          self._cache[path] = result
>      return result
> get_realpath_and_stat = GetRealpathAndStat()
>
>
> Cheers,
> Mike
>
> Mark Bakker wrote:
>
> > John, Michael -
> >
> > Now that we are talking about a new release, did you guys ever manage to
> > fix the bug described below. It had to do with greek symbols not showing up
> > in postscript files on windows. John seemed to have tracked down the source
> > of the problem, but I never heard of a solution.
> >
> > Thanks,
> >
> > Mark
> >
> > On Tue, Mar 25, 2008 at 7:50 PM, John Hunter <[EMAIL PROTECTED] <mailto:
> > [EMAIL PROTECTED]>> wrote:
> >
> >    On Tue, Mar 25, 2008 at 12:02 PM, Michael Droettboom
> >    <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:
> >
> >    > The *intention* is that the fonts *should* be included (with the
> >    >  exception of ps.useafm == True).  That was definitely not a
> >    deliberate
> >    >  change.
> >    >
> >    >  However, as one of the ones who hasn't been able to reproduce this
> >    >  problem, I'm afraid I'm not of much help.  From reading the
> >    code, I'm
> >    >  still completely stumped as to why the font is not embedded.
> >     Someone
> >    >  will have to step through with a debugger on one of the broken
> >    systems
> >    >  to figure this out, I'm afraid.
> >
> >    I was able to replicate the bug and find the source of the problem.
> >  I
> >    am not 100% sure how to fix it, but someone who knows os.stat better
> >    might.  The problem is that matplotlib.cbook.get_realpath_and_stat
> >
> >    class GetRealpathAndStat:
> >       def __init__(self):
> >           self._cache = {}
> >
> >       def __call__(self, path):
> >           result = self._cache.get(path)
> >           if result is None:
> >               realpath = os.path.realpath(path)
> >               stat = os.stat(realpath)
> >               stat_key = (stat.st_ino, stat.st_dev)
> >               result = realpath, stat_key
> >               self._cache[path] = result
> >           return result
> >    get_realpath_and_stat = GetRealpathAndStat()
> >
> >
> >    is returning the same stat ino and dev for all the font files, and
> >    thus the renderer.used_characters dictionary is getting improper keys
> >    -- always (0,0).  So the first font in the gate, in this case Vera,
> > is
> >    getting a place in the dict and subsequent fonts (the cm* ones) are
> >    not.  The basic problem is that the inode and dev appear to be unix
> >    only.
> >
> >    Michael: if you let me know better what this key is supposed to be
> >    doing (can we not simply use the filename for windows?) then I can
> >    attempt or test some fixes.
> >
> >    JDH
> >
> >
> >
> --
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
>
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to