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

test_linter_should_be_pickable fails #26

Closed
mweinelt opened this issue Apr 20, 2022 · 4 comments
Closed

test_linter_should_be_pickable fails #26

mweinelt opened this issue Apr 20, 2022 · 4 comments

Comments

@mweinelt
Copy link

We are seeing the following test failure on 0.7 with python 3.9.12 and pylint 2.13.5.

_______________________ test_linter_should_be_pickleable _______________________

linter = Checker 'master' (responsible for 'F0001', 'F0002', 'F0010', 'F0011', 'I0001', 'I0010', 'I0011', 'I0013', 'I0020', 'I0021', 'I0022', 'E0001', 'E0011', 'E0012', 'E0013', 'E0014')

    def test_linter_should_be_pickleable(linter):
        # Setup
        linter.register_checker(TypeChecker())
        augment_visit(linter, TypeChecker.visit_attribute, fake_augmentation_func)
        suppress_message(
            linter, TypeChecker.visit_attribute, "no-member", fake_suppress_func
        )
    
        # Act and Assert
>       pickle.dumps(linter)
E       TypeError: cannot pickle 'EncodedFile' object

tests/test_linter_pickle.py:25: TypeError
@DanielNoord
Copy link

This is likely due to our switch to dill to pickle the PyLinter object.

Package can be found over at https://github.com/uqfoundation/dill.

@mweinelt
Copy link
Author

mweinelt commented Jun 1, 2022

Our pylint package already had dill 0.3.4 at that point, and it's still reproducible for us.

@DanielNoord
Copy link

No but the test seems to use pickle.dumps() which will never be able to pickle linter as pickle doesn't support pickling PyLinter.

carlio pushed a commit that referenced this issue May 14, 2023
carlio pushed a commit that referenced this issue May 14, 2023
@carlio
Copy link
Collaborator

carlio commented May 14, 2023

This has been fixed on master so I will close it now and make a release tomorrow.

@carlio carlio closed this as completed May 14, 2023
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

3 participants