Skip to content

Use io.BytesIO instead of io.StringIO in examples #6205

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 2 commits into from
Mar 26, 2016

Conversation

mdboom
Copy link
Member

@mdboom mdboom commented Mar 22, 2016

Fixes #6201.

@mdboom mdboom added this to the 1.5.2 (Critical bug fix release) milestone Mar 22, 2016
@@ -52,7 +52,7 @@
ax.set_ylim(0., 1.)

# save the figure as a string in the svg format.
from io import StringIO
from six import StringIO
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we use the internal six?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

er, no this is in the examples, we should not be teaching anyone to use our internal six.

@QuLogic
Copy link
Member

QuLogic commented Mar 23, 2016

I still think it'd be better to switch to BytesIO in all cases instead of introducing six in the examples.

@tacaswell
Copy link
Member

👍 on less use of six

@mdboom mdboom changed the title Use six.StringIO instead of io.StringIO in examples Use io.BytesIO instead of io.StringIO in examples Mar 23, 2016
@mdboom
Copy link
Member Author

mdboom commented Mar 23, 2016

I've updated this (and the title of this issue) to use io.BytesIO instead.

@@ -664,8 +664,9 @@ Here is an example using `Pillow <http://python-imaging.github.io/>`_.
First, the figure is saved to a StringIO object which is then fed to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change here also.

@tacaswell tacaswell merged commit f66d255 into matplotlib:master Mar 26, 2016
tacaswell added a commit that referenced this pull request Mar 27, 2016
Use io.BytesIO instead of io.StringIO in examples
@tacaswell
Copy link
Member

backported to 1.5.1-doc as 40cfef1

bearstrong pushed a commit to bearstrong/matplotlib that referenced this pull request Apr 1, 2016
Use io.BytesIO instead of io.StringIO in examples
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.

5 participants