Fix writing pdf on stdout #1130

Merged
merged 1 commit into from Aug 26, 2012

Projects

None yet

3 participants

@jkseppan
Matplotlib Developers member

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

@jkseppan jkseppan 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.
f829bb5
@mdboom
Matplotlib Developers member

This looks like a good solution.

@KennethNielsen

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

@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
Matplotlib Developers member

Great! I'm going to merge this.

@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