diff --git a/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_AMD64_windows_2.7.3.pickle b/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_AMD64_windows_2.7.3.pickle new file mode 100644 index 0000000000000..f03ec67f4d7c4 Binary files /dev/null and b/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_AMD64_windows_2.7.3.pickle differ diff --git a/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_i686_linux_2.6.5.pickle b/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_i686_linux_2.6.5.pickle new file mode 100644 index 0000000000000..aa2f607fa4302 Binary files /dev/null and b/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_i686_linux_2.6.5.pickle differ diff --git a/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_i686_linux_2.7.3.pickle b/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_i686_linux_2.7.3.pickle new file mode 100644 index 0000000000000..5c988a1b0c7ef Binary files /dev/null and b/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_i686_linux_2.7.3.pickle differ diff --git a/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_i686_linux_3.2.3.pickle b/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_i686_linux_3.2.3.pickle new file mode 100644 index 0000000000000..275cc4b951134 Binary files /dev/null and b/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_i686_linux_3.2.3.pickle differ diff --git a/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_x86_64_darwin_2.7.5.pickle b/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_x86_64_darwin_2.7.5.pickle new file mode 100644 index 0000000000000..0ff7f6c68f34e Binary files /dev/null and b/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_x86_64_darwin_2.7.5.pickle differ diff --git a/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_x86_64_linux_2.7.3.pickle b/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_x86_64_linux_2.7.3.pickle new file mode 100644 index 0000000000000..0ff7f6c68f34e Binary files /dev/null and b/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_x86_64_linux_2.7.3.pickle differ diff --git a/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_x86_64_linux_3.3.0.pickle b/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_x86_64_linux_3.3.0.pickle new file mode 100644 index 0000000000000..5f27dd2ff056d Binary files /dev/null and b/pandas/io/tests/data/legacy_pickle/0.13.0/0.13.0_x86_64_linux_3.3.0.pickle differ diff --git a/pandas/io/tests/generate_legacy_pickles.py b/pandas/io/tests/generate_legacy_pickles.py index 05e5d68379b09..08f63b0179db2 100644 --- a/pandas/io/tests/generate_legacy_pickles.py +++ b/pandas/io/tests/generate_legacy_pickles.py @@ -1,12 +1,6 @@ """ self-contained to write legacy pickle files """ from __future__ import print_function -# make sure we are < 0.13 compat (in py3) -try: - from pandas.compat import zip, cPickle as pickle -except: - import pickle - def _create_sp_series(): import numpy as np @@ -114,21 +108,35 @@ def write_legacy_pickles(): import sys sys.path.insert(0,'.') - import os + import os, os.path import numpy as np import pandas import pandas.util.testing as tm import platform as pl - print("This script generates a pickle file for the current arch, system, and python version") + # make sure we are < 0.13 compat (in py3) + try: + from pandas.compat import zip, cPickle as pickle + except: + import pickle + + sys_version = version = pandas.__version__ + if len(sys.argv) < 2: + exit("{0} ".format(sys.argv[0])) - version = pandas.__version__ + version = str(sys.argv[1]) + output_dir = str(sys.argv[2]) + + print("This script generates a pickle file for the current arch, system, and python version") + print(" system version: {0}".format(sys_version)) + print(" output version: {0}".format(version)) + print(" output dir : {0}".format(output_dir)) # construct a reasonable platform name f = '_'.join([ str(version), str(pl.machine()), str(pl.system().lower()), str(pl.python_version()) ]) pth = '{0}.pickle'.format(f) - fh = open(pth,'wb') + fh = open(os.path.join(output_dir,pth),'wb') pickle.dump(create_data(),fh,pickle.HIGHEST_PROTOCOL) fh.close() diff --git a/pandas/io/tests/test_pickle.py b/pandas/io/tests/test_pickle.py index 167eed95fd5a6..ea769a0515a78 100644 --- a/pandas/io/tests/test_pickle.py +++ b/pandas/io/tests/test_pickle.py @@ -80,6 +80,9 @@ def test_read_pickles_0_11_0(self): def test_read_pickles_0_12_0(self): self.read_pickles('0.12.0') + def test_read_pickles_0_13_0(self): + self.read_pickles('0.13.0') + def test_round_trip_current(self): for typ, dv in self.data.items(): diff --git a/setup.py b/setup.py index 635da56d7339f..6ab478bfc2541 100755 --- a/setup.py +++ b/setup.py @@ -555,6 +555,7 @@ def pxd(name): 'tests/data/legacy_pickle/0.10.1/*.pickle', 'tests/data/legacy_pickle/0.11.0/*.pickle', 'tests/data/legacy_pickle/0.12.0/*.pickle', + 'tests/data/legacy_pickle/0.13.0/*.pickle', 'tests/data/*.csv', 'tests/data/*.dta', 'tests/data/*.txt',