Skip to content
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

Fix writing pdf on stdout #1130

Merged
merged 1 commit into from
Aug 26, 2012
Merged

Fix writing pdf on stdout #1130

merged 1 commit into from
Aug 26, 2012

Conversation

jkseppan
Copy link
Member

Could @KennethNielsen try to see if this fixes #1089?

Writing on file-like objects broke object cross-references if
anything else had been written on the same stream before. On Linux
writing on sys.stdout failed because sys.stdout.tell() raises
an error; this is worked around by using a BytesIO object.
@mdboom
Copy link
Member

mdboom commented Aug 21, 2012

This looks like a good solution.

@KennethNielsen
Copy link

Hallo @jkseppan and thank you very much for working on this (must admit that I didn't feel too positive about being able to do it myself after opening the ~2500 lines pdf backend file ;) ). I will try to get around to test it tomorrow or in the weekend.

@KennethNielsen
Copy link

@jkseppan I have now tested this by saving a simple figure to stdout and piping the output to a file. I have done this on both a Debian and Red Hat based linux distribution (Ubuntu 12.04 and Fedora 16 respective) and it works like a charm. Thanks once again.

@mdboom
Copy link
Member

mdboom commented Aug 26, 2012

Great! I'm going to merge this.

mdboom added a commit that referenced this pull request Aug 26, 2012
@mdboom mdboom merged commit 0ee82be into matplotlib:master Aug 26, 2012
@jkseppan jkseppan deleted the pdf-on-stdout branch July 6, 2015 11:44
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.

savefig to sys.stdout fails with pdf backend
3 participants