Fix writing pdf on stdout #1130

merged 1 commit into from Aug 26, 2012


None yet
3 participants

jkseppan commented Aug 21, 2012

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

Fix writing pdf on stdout
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 commented Aug 21, 2012

This looks like a good solution.

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.

@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 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 jkseppan:pdf-on-stdout branch Jul 6, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment