Skip to content
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

Failure to load dumped partial function (in older python) properly (in newer python) #652

Open
mart-r opened this issue Apr 3, 2024 · 0 comments

Comments

@mart-r
Copy link

mart-r commented Apr 3, 2024

Firstly, it's very much possible that this is not an issue with dill, specifically. But I thought I'd post it here first since that seemed the most relevant to me.

Secondly, it's possible I've overlooked something simple and this is not an actual issue. If so, I do apologise. I did try and look for an existing issue but could not seem to find one.

Now for the issue at hand.

When using dill.dump to save a partial function in python<3.11 the result can not be read off the disk in python3.11 (didn't try 3.12) in a working order. To be specific, the partial method is read off the disk, but cannot be successfully called.

The minimal-ish version I ran into the issue with:
DUMP: https://gist.github.com/mart-r/0f1bb54fa2bad0df470e3f70075156ae
LOAD: https://gist.github.com/mart-r/358f112097cfeca1f05babec469992c0

Scenario 1 (Working on 3.10)

  • DUMP on 3.10
  • LOAD on 3.10
  • Working as expected

Scenario 2 (Working on 3.11)

  • DUMP on 3.11
  • LOAD on 3.11
  • Working as expected

Scenario 3 (NOT WORKING)

  • DUMP on 3.10
  • LOAD on 3.11
  • See an error (TypeError: 'int' object is not callable)

The tests were carried out:

  • OS: Ubuntu 22.04.4 LTS kernel 6.5.0-26
  • Python3.10.12
    • Latest available on Ubuntu natively
  • Python3.11.8
    • Latest available on Ubuntu natively
  • dill==0.3.8

PS:
The issue first came to my attention for a bigger gap in python version (as well as a change in dill version). However, I got to this example when trying to figure out what was going wrong.

Any guidance would be much appreciated. Even if it is to go and learn something new.

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

No branches or pull requests

1 participant