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

Pickle Exception.__cause__ and Exception.__traceback__ #54

Merged
merged 10 commits into from
Dec 7, 2019

Conversation

crusaderky
Copy link

Closes #53

@codecov-io
Copy link

codecov-io commented Nov 28, 2019

Codecov Report

Merging #54 into master will increase coverage by 0.92%.
The diff coverage is 95.34%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #54      +/-   ##
==========================================
+ Coverage   88.46%   89.38%   +0.92%     
==========================================
  Files           4        4              
  Lines         208      245      +37     
  Branches       29       42      +13     
==========================================
+ Hits          184      219      +35     
- Misses         15       16       +1     
- Partials        9       10       +1
Impacted Files Coverage Δ
src/tblib/pickling_support.py 96.29% <95.34%> (-3.71%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5b9a460...50f3ec1. Read the comment docs.

@crusaderky
Copy link
Author

@ionelmc ready for review and merge

@crusaderky crusaderky closed this Dec 2, 2019
@crusaderky crusaderky reopened this Dec 2, 2019
@crusaderky
Copy link
Author

@ionelmc I've implemented all suggestions; ready for second review.
codecov is currently glitching as it seems to ignore several test suites (not the first time I see it).

@crusaderky
Copy link
Author

@ionelmc any update?

Thanks

@ionelmc
Copy link
Owner

ionelmc commented Dec 5, 2019

Ooooooof sorry, I'll look later today. Looks very good so far.

@ionelmc ionelmc merged commit 1ce5319 into ionelmc:master Dec 7, 2019
@ionelmc
Copy link
Owner

ionelmc commented Dec 7, 2019

Very good, released v1.6.0 just now.

@blueyed
Copy link

blueyed commented Feb 17, 2020

I have not investigated, but this (c6d1796) causes test failures with pytest-parallel: kevlened/pytest-parallel#62

multiprocessing.managers.RemoteError:
---------------------------------------------------------------------------
Unserializable message: Traceback (most recent call last):
  File "/usr/lib/python3.8/multiprocessing/managers.py", line 298, in serve_client
    send(msg)
  File "/usr/lib/python3.8/multiprocessing/connection.py", line 206, in send
    self._send_bytes(_ForkingPickler.dumps(obj))
  File "/usr/lib/python3.8/multiprocessing/reduction.py", line 51, in dumps
    cls(buf, protocol).dump(obj)
_pickle.PicklingError: Can't pickle <function unpickle_exception at 0x7f67e4eb7040>: it's not the same object as tblib.pickling_support.unpickle_exception

blueyed added a commit to blueyed/pytest-parallel that referenced this pull request Feb 17, 2020
@blueyed
Copy link

blueyed commented Feb 17, 2020

The workaround/fix is to move from tblib import pickling_support out of the Thread.run method: kevlened/pytest-parallel@be0975d

@ionelmc
Copy link
Owner

ionelmc commented Feb 17, 2020

Would love to see some explanation on what's going on.

@crusaderky crusaderky deleted the pickle_exceptions branch February 18, 2020 17:03
@crusaderky
Copy link
Author

I, too, struggle to see how importing the module inside a slave thread can be any different from importing it in the main thread.

@blueyed
Copy link

blueyed commented Feb 18, 2020

Likely because install is doing more, and it might be the unpickle_exception from here? https://github.com/ionelmc/python-tblib/pull/54/files#diff-e61172fc1c18da0c20eef41cc3bbcd73R45

@crusaderky
Copy link
Author

if you read the code, install isn't doing anything fancy at all, and unpickle_exception is a perfectly vanilla function defined at the top level of a globally-accessible Python module.

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

Successfully merging this pull request may close these issues.

New feature: pickle Exception, its cause, and traceback
4 participants