File tree 4 files changed +17
-17
lines changed
4 files changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -294,6 +294,8 @@ pandas 0.12
294
294
- ``Series.hist `` will now take the figure from the current environment if
295
295
one is not passed
296
296
- Fixed bug where a 1xN DataFrame would barf on a 1xN mask (:issue: `4071 `)
297
+ - Fixed running of ``tox `` under python3 where the pickle import was getting
298
+ rewritten in an incompatible way (:issue: `4062 `, :issue: `4063 `)
297
299
298
300
299
301
pandas 0.11.0
Original file line number Diff line number Diff line change @@ -437,6 +437,8 @@ Bug Fixes
437
437
- ``Series.hist`` will now take the figure from the current environment if
438
438
one is not passed
439
439
- Fixed bug where a 1xN DataFrame would barf on a 1xN mask (:issue:`4071`)
440
+ - Fixed running of ``tox`` under python3 where the pickle import was getting
441
+ rewritten in an incompatible way (:issue:`4062`, :issue:`4063`)
440
442
441
443
See the :ref:`full release notes
442
444
<release>` or issue tracker
Original file line number Diff line number Diff line change 1
- # XXX: HACK for NumPy 1.5.1 to suppress warnings
2
- try :
3
- import cPickle as pickle
4
- except ImportError : # pragma: no cover
5
- import pickle
1
+ import cPickle as pkl
2
+
6
3
7
4
def to_pickle (obj , path ):
8
5
"""
@@ -14,11 +11,9 @@ def to_pickle(obj, path):
14
11
path : string
15
12
File path
16
13
"""
17
- f = open (path , 'wb' )
18
- try :
19
- pickle .dump (obj , f , protocol = pickle .HIGHEST_PROTOCOL )
20
- finally :
21
- f .close ()
14
+ with open (path , 'wb' ) as f :
15
+ pkl .dump (obj , f , protocol = pkl .HIGHEST_PROTOCOL )
16
+
22
17
23
18
def read_pickle (path ):
24
19
"""
@@ -38,11 +33,11 @@ def read_pickle(path):
38
33
unpickled : type of object stored in file
39
34
"""
40
35
try :
41
- with open (path ,'rb' ) as fh :
42
- return pickle .load (fh )
36
+ with open (path , 'rb' ) as fh :
37
+ return pkl .load (fh )
43
38
except :
44
- from pandas .util import py3compat
45
- if not py3compat . PY3 :
46
- raise
47
- with open ( path , 'rb' ) as fh :
48
- return pickle . load ( fh , encoding = 'latin1' )
39
+ from pandas .util . py3compat import PY3
40
+ if PY3 :
41
+ with open ( path , 'rb' ) as fh :
42
+ return pkl . load ( fh , encoding = 'latin1' )
43
+ raise
Original file line number Diff line number Diff line change @@ -25,3 +25,4 @@ for e in $ENVS; do
25
25
echo " [launching tox for $e ]"
26
26
tox -c " $TOX_INI_PAR " -e " $e " &
27
27
done
28
+ wait
You can’t perform that action at this time.
0 commit comments