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

Slipcover causes Pickler failure #3

Closed
jaltmayerpizzorno opened this issue Apr 27, 2022 · 1 comment
Closed

Slipcover causes Pickler failure #3

jaltmayerpizzorno opened this issue Apr 27, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@jaltmayerpizzorno
Copy link
Collaborator

A test in attrs' suite fails because Slipcover's tracker is held within a PyCapsule.

$ python3 -m slipcover --silent -m pytest -x
============================================================ test session starts =============================================================
platform darwin -- Python 3.9.12, pytest-7.0.1, pluggy-1.0.0
rootdir: /Users/juan/tmp/attrs, configfile: tox.ini, testpaths: tests
collected 1203 items                                                                                                                         

tests/test_3rd_party.py F

================================================================== FAILURES ==================================================================
______________________________________________________ TestCloudpickleCompat.test_repr _______________________________________________________

self = <tests.test_3rd_party.TestCloudpickleCompat object at 0x10911f970>

    @given(simple_classes())
>   def test_repr(self, cls):

tests/test_3rd_party.py:23: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_3rd_party.py:30: in test_repr
    pkl = cloudpickle.dumps(inst)
/usr/local/lib/python3.9/site-packages/cloudpickle/cloudpickle_fast.py:73: in dumps
    cp.dump(obj)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <cloudpickle.cloudpickle_fast.CloudPickler object at 0x109ae0880>, obj = HypClass()

    def dump(self, obj):
        try:
>           return Pickler.dump(self, obj)
E           TypeError: cannot pickle 'PyCapsule' object

/usr/local/lib/python3.9/site-packages/cloudpickle/cloudpickle_fast.py:563: TypeError
------------------------------------------------------------ Captured stdout call ------------------------------------------------------------
Falsifying example: test_repr(
    cls=tests.strategies.HypClass,
    self=<tests.test_3rd_party.TestCloudpickleCompat at 0x10911f970>,
)
========================================================== short test summary info ===========================================================
FAILED tests/test_3rd_party.py::TestCloudpickleCompat::test_repr - TypeError: cannot pickle 'PyCapsule' object
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================= 1 failed in 0.57s ==============================================================

@jaltmayerpizzorno jaltmayerpizzorno added the bug Something isn't working label Apr 27, 2022
asford added a commit to asford/slipcover that referenced this issue Nov 29, 2022
@jaltmayerpizzorno
Copy link
Collaborator Author

This issue has been resolved for Python 3.12+ due to SlipCover's move to using sys.monitoring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant