Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

savefig crash on .eps filename #620

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 13, 2011
Merged

savefig crash on .eps filename #620

merged 1 commit into from
Dec 13, 2011

Conversation

mdboom
Copy link
Member

@mdboom mdboom commented Dec 12, 2011

savefig crash on .eps filename,

Complainig that StrinIO does not exist here :
https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/backends/backend_ps.py#L1201

        if dryrun:
           class NullWriter(object):
                def write(self, *kl, **kwargs):
                    pass

            self._pswriter = NullWriter()
        else:
            self._pswriter = StringIO() #here

maybe should be replaced by something like that found a few (150) line above...
https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/backends/backend_ps.py#L1045

        if dryrun:
           class NullWriter(object):
                def write(self, *kl, **kwargs):
                    pass

            self._pswriter = NullWriter()
        else:
            if sys.version_info[0] >= 3:
                self._pswriter = io.StringIO()
            else:
                self._pswriter = cStringIO.StringIO()

or change the import on the top to import either cStingIO.StringIO or io.StringIO as StrinIO but as I don't know the internal I prefer to leave the pro doing something.

crashing example:

matplotlib.rcParams['text.usetex']=True
plot(range(10))
savefig('test.eps')

Hopping I'm not doing anything wrong on my side...
Thank you for the great work, I appreciate matplotlib more and more every day

@ghost ghost assigned mdboom Dec 12, 2011
@mdboom
Copy link
Member

mdboom commented Dec 12, 2011

It turns out there was a whole raft of untested code on master when using usetex with the PS backend. Can you please test the attached pull request and let me know if it resolves your issue?

@Carreau
Copy link
Contributor Author

Carreau commented Dec 13, 2011

I've tried by just replacing the file, and it seen to works (haven't deeply tried but previous example + xlabel(r'$\alpha$') does.

Another bug, same example but with test.pdf, but i'll open another issues as detailled as this one.

thank you.

mdboom added a commit that referenced this pull request Dec 13, 2011
savefig crash on .eps filename
@mdboom mdboom merged commit fc0acb8 into master Dec 13, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.