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