Revision: 8413
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8413&view=rev
Author:   efiring
Date:     2010-06-11 08:34:24 +0000 (Fri, 11 Jun 2010)

Log Message:
-----------
[3013559] cbook.get_sample_data: open image file in binary mode. Patch by C. 
Gohlke.

Modified Paths:
--------------
    trunk/matplotlib/lib/matplotlib/cbook.py

Modified: trunk/matplotlib/lib/matplotlib/cbook.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/cbook.py    2010-06-11 08:09:25 UTC (rev 
8412)
+++ trunk/matplotlib/lib/matplotlib/cbook.py    2010-06-11 08:34:24 UTC (rev 
8413)
@@ -619,7 +619,11 @@
         fname = cached[0]
 
         if asfileobj:
-            return file(fname)
+            if os.path.splitext(fname)[-1].lower() in ('.csv', '.xrc', '.txt'):
+                mode = 'r'
+            else:
+                mode = 'rb'
+            return open(fname, mode)
         else:
             return fname
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to