usetex w/ preview.sty

Michael Droettboom <mdroe@...31...> writes:

I'm currently getting this traceback with the PDF backend, whether
"text.latex.preview" is True or False -- so it may be unrelated to your
change, but I'm unable to test PDF at the moment.

Based on the traceback, it looks like I have broken something recently --
but what is the exact exception? I can't replicate the traceback myself.

···

--
Jouni K. Sepp�nen

Sorry about the wild good chase. I had fixed up an earlier exception which was simply a problem with formatting a verbose message. That gives this, when running usetex_fonteffects.py (with all rcParams at defaults):

Traceback (most recent call last):
  File "usetex_fonteffects.py", line 22, in <module>
    pylab.savefig('usetex_fonteffects.pdf')
  File "/home/mdroe/usr/lib/python2.5/site-packages/matplotlib/pyplot.py", line 345, in savefig
    return fig.savefig(*args, **kwargs)
  File "/home/mdroe/usr/lib/python2.5/site-packages/matplotlib/figure.py", line 990, in savefig
    self.canvas.print_figure(*args, **kwargs)
  File "/home/mdroe/usr/lib/python2.5/site-packages/matplotlib/backend_bases.py", line 1429, in print_figure
    **kwargs)
  File "/home/mdroe/usr/lib/python2.5/site-packages/matplotlib/backend_bases.py", line 1323, in print_pdf
    return pdf.print_pdf(*args, **kwargs)
  File "/home/mdroe/usr/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py", line 1911, in print_pdf
    file.close()
  File "/home/mdroe/usr/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py", line 440, in close
    self.writeFonts()
  File "/home/mdroe/usr/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py", line 521, in writeFonts
    fontdictObject = self.embedType1(filename, self.dviFontInfo[filename])
  File "/home/mdroe/usr/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py", line 550, in embedType1
    ' and effects ' + `fontinfo.effects`,
TypeError: cannot concatenate 'str' and 'NoneType' objects
> /home/mdroe/usr/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py(550)embedType1()
-> ' and effects ' + `fontinfo.effects`,*

···

*
Do an SVN update (r6736) and try again. Then I get this:

> python usetex_fonteffects.py
Traceback (most recent call last):
  File "usetex_fonteffects.py", line 22, in <module>
    pylab.savefig('usetex_fonteffects.pdf')
  File "/home/mdroe/usr/lib/python2.5/site-packages/matplotlib/pyplot.py", line 345, in savefig
    return fig.savefig(*args, **kwargs)
  File "/home/mdroe/usr/lib/python2.5/site-packages/matplotlib/figure.py", line 990, in savefig
    self.canvas.print_figure(*args, **kwargs)
  File "/home/mdroe/usr/lib/python2.5/site-packages/matplotlib/backend_bases.py", line 1429, in print_figure
    **kwargs)
  File "/home/mdroe/usr/lib/python2.5/site-packages/matplotlib/backend_bases.py", line 1323, in print_pdf
    return pdf.print_pdf(*args, **kwargs)
  File "/home/mdroe/usr/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py", line 1911, in print_pdf
    file.close()
  File "/home/mdroe/usr/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py", line 440, in close
    self.writeFonts()
  File "/home/mdroe/usr/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py", line 521, in writeFonts
    fontdictObject = self.embedType1(filename, self.dviFontInfo[filename])
  File "/home/mdroe/usr/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py", line 553, in embedType1
    t1font = type1font.Type1Font(fontinfo.fontfile)
  File "/home/mdroe/usr/lib/python2.5/site-packages/matplotlib/type1font.py", line 55, in __init__
    file = open(input, 'rb')
TypeError: coercing to Unicode: need string or buffer, NoneType found
> /home/mdroe/usr/lib/python2.5/site-packages/matplotlib/type1font.py(55)__init__()
-> file = open(input, 'rb')

So somehow, input is None, but I haven't had a chance to look any further.

Cheers,
Mike

Jouni K. Sepp�nen wrote:

Michael Droettboom <mdroe@...31...> writes:

I'm currently getting this traceback with the PDF backend, whether "text.latex.preview" is True or False -- so it may be unrelated to your change, but I'm unable to test PDF at the moment.
    
Based on the traceback, it looks like I have broken something recently --
but what is the exact exception? I can't replicate the traceback myself.

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA