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

Merged
merged 2 commits into from Mar 26, 2016

Conversation

Projects
None yet
5 participants
Owner

mdboom commented Mar 22, 2016

Fixes #6201.

mdboom added the needs_review label Mar 22, 2016

@WeatherGod WeatherGod and 1 other commented on an outdated diff Mar 22, 2016

examples/misc/svg_filter_line.py
@@ -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
@WeatherGod

WeatherGod Mar 22, 2016

Member

should we use the internal six?

@tacaswell

tacaswell Mar 23, 2016

Owner

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

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.

Owner

tacaswell commented Mar 23, 2016

👍 on less use of six

@mdboom mdboom Use io.BytesIO instead of io.StringIO in examples
c212d86

mdboom changed the title from Use six.StringIO instead of io.StringIO in examples to Use io.BytesIO instead of io.StringIO in examples Mar 23, 2016

Owner

mdboom commented Mar 23, 2016

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

@efiring efiring commented on an outdated diff Mar 23, 2016

doc/faq/howto_faq.rst
@@ -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
@efiring

efiring Mar 23, 2016

Owner

Change here also.

@QuLogic QuLogic commented on an outdated diff Mar 23, 2016

doc/faq/howto_faq.rst
@@ -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
Pillow for further processing::
- import StringIO, Image
- imgdata = StringIO.StringIO()
+ from io import BytesIO
+ import Image
@QuLogic

QuLogic Mar 23, 2016

Member

Also, while you're here, should this not be from PIL import Image?

@QuLogic QuLogic commented on an outdated diff Mar 23, 2016

examples/misc/svg_filter_line.py
@@ -52,8 +52,8 @@
ax.set_ylim(0., 1.)
# save the figure as a string in the svg format.
@QuLogic

QuLogic Mar 23, 2016

Member

Comment still says string.

@mdboom mdboom Address comments in PR
4f17dbd

@tacaswell tacaswell merged commit f66d255 into matplotlib:master Mar 26, 2016

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

tacaswell removed the needs_review label Mar 26, 2016

@tacaswell tacaswell added a commit that referenced this pull request Mar 27, 2016

@tacaswell tacaswell Merge pull request #6205 from mdboom/fix-stringio
Use io.BytesIO instead of io.StringIO in examples
40cfef1
Owner

tacaswell commented Mar 27, 2016

backported to 1.5.1-doc as 40cfef1

@bearstrong bearstrong added a commit to bearstrong/matplotlib that referenced this pull request Apr 1, 2016

@tacaswell @bearstrong tacaswell + bearstrong Merge pull request #6205 from mdboom/fix-stringio
Use io.BytesIO instead of io.StringIO in examples
5a0267c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment