Re: [Matplotlib-users] PDF Backend problem still unresolved

2007-03-18 Thread kc106_2005-matplotlib
Thanks for the reply, Jouni.

I am running Python 2.3 on Windows XP, latest version of MPL.

I'll see if I can reproduce the problem using standard examples.



Regards,

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On 
 Behalf Of Jouni K Seppänen
 Sent: Saturday, March 17, 2007 1:06 PM
 To: matplotlib-users@lists.sourceforge.net
 Subject: Re: [Matplotlib-users] PDF Backend problem still unresolved
 
 
  [EMAIL PROTECTED] writes:
 
   Starting with the 9th page, MPL chokes at line 1084 in 
   backend_pdf.py
  Jouni posted a couple of responses witih suggestions in CVS 
 syntax but 
  I was unable to use that information.
 
 I had to take my laptop to be to be repaired, so I can't do 
 much work on Matplotlib right now. In the meantime, please 
 post some more information: what version of Python and 
 Matplotlib is this, on which platform, can you reduce your 
 code to a small example that exhibits the bug, what output do 
 you get with verbose.level: debug?
 
 --
 Jouni
 
 
 
 --
 ---
 Take Surveys. Earn Cash. Influence the Future of IT
 Join SourceForge.net's Techsay panel and you'll get the 
 chance to share your opinions on IT  business topics through 
 brief surveys-and earn cash 
 http://www.techsay.com/default.php?page=join.phpp=sourceforge
CID=DEVDEV
___
Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

 
--
John Henry



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] PDF Backend problem still unresolved

2007-03-17 Thread Jouni K Seppänen
 [EMAIL PROTECTED] writes:

  Starting with the 9th page, MPL chokes at line 1084 in
  backend_pdf.py
 Jouni posted a couple of responses witih suggestions in CVS syntax
 but I was unable to use that information.

I had to take my laptop to be to be repaired, so I can't do much work
on Matplotlib right now. In the meantime, please post some more information:
what version of Python and Matplotlib is this, on which platform, can you
reduce your code to a small example that exhibits the bug, what output do
you get with verbose.level: debug?

--
Jouni



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] PDF backend problem

2007-03-14 Thread kc106_2005-matplotlib
Jouni,

Are you certain the version you sent me is correct?  It didn't make any 
difference - I get the same error messages.

Regards,

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On 
 Behalf Of Jouni K. Seppänen
 Sent: Monday, March 12, 2007 11:20 PM
 To: matplotlib-users@lists.sourceforge.net
 Subject: Re: [Matplotlib-users] PDF backend problem
 
 
 I fixed another filehandle leak in the pdf backend, so here's 
 a more complete patch. There are also several cases of 
 file(...) being passed to pickle.dump or pickle.load in 
 font_manager.py. I was going to take care of these by writing 
 some utility functions, but I started wondering why the 
 import of cPickle or pickle is done only within methods of 
 FontManager and not at the top level. Are there some 
 platforms where neither is available, or what is the rationale?
 
 Index: backend_pdf.py 
 ===
 --- backend_pdf.py  (revision 3044)
 +++ backend_pdf.py  (revision 3046)
 @@ -457,7 +457,9 @@
  self.writeObject(self.fontObject, fonts)
  
  def _write_afm_font(self, filename):
 -font = AFM(file(filename))
 +fh = file(filename)
 +font = AFM(fh)
 +fh.close()
  fontname = font.get_fontname()
  fontdict = { 'Type': Name('Font'),
   'Subtype': Name('Type1'),
 @@ -1081,7 +1083,9 @@
  font = self.afm_font_cache.get(key)
  if font is None:
  filename = fontManager.findfont(prop, fontext='afm')
 -font = AFM(file(filename))
 +fh = file(filename)
 +font = AFM(fh)
 +fh.close()
  self.afm_font_cache[key] = font
  return font
 
 -- 
 Jouni K. Seppänen
 http://www.iki.fi/jks
 
 
 --
 ---
 Take Surveys. Earn Cash. Influence the Future of IT
 Join SourceForge.net's Techsay panel and you'll get the 
 chance to share your opinions on IT  business topics through 
 brief surveys-and earn cash 
 http://www.techsay.com/default.php?page=join.phpp=sourceforge
CID=DEVDEV
___
Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

 
--
John Henry



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] PDF backend problem

2007-03-12 Thread Jouni K . Seppänen
[EMAIL PROTECTED] writes:

 Now, I am running into another problem. Everything works fine up to
 8 page plots. Starting with the 9th page, MPL chokes at line 1084 in
 backend_pdf.py and couldn't find the cooresponding ttf file
 (VeraSe.ttf) but it had no problem reading that file for the first 8
 plots.

Does the following change help with this? (If you are following svn,
just run svn update; otherwise, the easiest way is to replace line
1084 by the three lines prefixed with + below.)

Index: backend_pdf.py
===
--- backend_pdf.py  (revision 3044)
+++ backend_pdf.py  (revision 3045)
@@ -1081,7 +1081,9 @@
 font = self.afm_font_cache.get(key)
 if font is None:
 filename = fontManager.findfont(prop, fontext='afm')
-font = AFM(file(filename))
+fh = file(filename)
+font = AFM(fh)
+fh.close()
 self.afm_font_cache[key] = font
 return font

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users