Skip to content

API: create option to allow pandas to patch pickle.load/loads at runtime for compat #5923

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jreback opened this issue Jan 13, 2014 · 7 comments
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Jan 13, 2014

related #5661
maybe `io.pickle.compat = 'global/local``

where we only allow local changes to the UnPickler.

This is not destructive, just 'bad practive', but weighing against more usability

@ghost
Copy link

ghost commented Jan 13, 2014

pandas was patching the stdlib on import?? that's really not ok.

It's wrong to provide any mechanism that hides that fact behind a innocent-looking option.
Users can monkey patch explicitly in their main thread of control, which forces them to
know exactly what they're doing and take responsibility for it.

It's unfortunate that fixing this broke code for users but it shouldn't be part of pandas.
Shouldn't propagate bad behavior for legacy reasons in this case IMO.

@jreback
Copy link
Contributor Author

jreback commented Jan 13, 2014

@y-p no ...not in the released version (and not currently) (well was for a very short period of time until the referenced PR)

@ghost
Copy link

ghost commented Jan 13, 2014

Thank god for that. no. monkey. patching. :)

@jreback
Copy link
Contributor Author

jreback commented Jan 13, 2014

hahah! I hear ya...ok...closing this

@ghost
Copy link

ghost commented Jan 19, 2014

I just got

./test_fast.sh 
Traceback (most recent call last):
  File "/bin/nosetests", line 9, in <module>
    load_entry_point('nose==1.3.0', 'console_scripts', 'nosetests')()
  File "/usr/lib/python2.7/site-packages/nose/core.py", line 118, in __init__
    **extra_args)
  File "/usr/lib64/python2.7/unittest/main.py", line 94, in __init__
    self.parseArgs(argv)
  File "/usr/lib/python2.7/site-packages/nose/core.py", line 169, in parseArgs
    self.createTests()
  File "/usr/lib/python2.7/site-packages/nose/core.py", line 183, in createTests
    self.test = self.testLoader.loadTestsFromNames(self.testNames)
  File "/usr/lib/python2.7/site-packages/nose/loader.py", line 468, in loadTestsFromNames
    plug_res = self.config.plugins.loadTestsFromNames(names, module)
  File "/usr/lib/python2.7/site-packages/nose/plugins/manager.py", line 99, in __call__
    return self.call(*arg, **kw)
  File "/usr/lib/python2.7/site-packages/nose/plugins/manager.py", line 179, in _loadTestsFromNames
    result = meth(names, module=module)
  File "/usr/lib/python2.7/site-packages/nose/plugins/testid.py", line 181, in loadTestsFromNames
    data = load(fh)
ValueError: unsupported pickle protocol: 3

with master.
nose saves a pickle files of test ids in the root dir, are you sure there's no funny business with pickle after importing pandas?

@jreback
Copy link
Contributor Author

jreback commented Jan 19, 2014

nope
you are trying to read a py3 pickle with py2
which doesn't work (reverse works of course)

@ghost
Copy link

ghost commented Jan 19, 2014

makes perfect sense, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant