A little update. It seems that this seems to be specific to Linux in some
way. I tried the original script from the PR under a couple of conditions:
* on Windows 7 Anaconda Python 2.7 and 3.4 -- everything works both versions
* on Anaconda Python 2.7 and 3.4 Linux version -- only the 2.7 version works
* on Gentoo Linux Python 2.7 and 3.4, MPL 1.4.3 -- only the 2.7 version
works
Hope that helps.
Ryan
On Fri, Mar 20, 2015 at 3:41 PM, Jerzy Karczmarczuk <
jerzy.karczmarc...@unicaen.fr> wrote:
>
> Le 20/03/2015 16:57, Ryan Nelson a écrit :
> > For me, if I change the script from the PR to what is shown below,
> > everything works fine in both Python 2.7 and 3.4 (Anaconda
> > environments, everything updated):
> > ##################
> > url = 'http://www.libpng.org/pub/png/img_png/pngnow.png'
> > try:
> > import urllib2
> > data = urllib2.urlopen(url)
> > except Exception:
> > import urllib.request
> > from io import BytesIO
> > data = BytesIO(urllib.request.urlopen(url).read())
> >
> > from matplotlib import pyplot
> >
> > image = pyplot.imread(data) # crash on py3.x
> > pyplot.imshow(image)
> > pyplot.show()
> > #################
> > But as you can see, the Python 3 version requires the addition of
> > BytesIO and read(). I take it that this is not supposed to be the case.
>
> It works for X.png, not for X.jpg. The call of imread() fails then.
> Tested also under 3.4/Anaconda.
>
> Jerzy Karczmarczuk
>
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website,
> sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for
> all
> things parallel software development, from weekly thought leadership blogs
> to
> news, videos, case studies, tutorials and more. Take a look and join the
> conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users