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

Add methods to StreamWrapper to allow better pickling #339

Merged
merged 1 commit into from
Mar 29, 2022
Merged

Add methods to StreamWrapper to allow better pickling #339

merged 1 commit into from
Mar 29, 2022

Conversation

DanielNoord
Copy link
Contributor

@DanielNoord DanielNoord commented Mar 29, 2022

Closes #86.

The popular python linter pylint has updated its pickler module from the stdlib pickle to the widely used dill package. However, users have run into issues with this as colorama apparently does not support pickling by dill. One user already identified this issue 6 years ago, but a fix was never submitted.

The following fixes the issue and passes all tests. We would appreciate if this could get merged as pylint is somewhat unable to return to pickle but we also don't want to stop supporting colorama.

As for a test, I didn't want to add dill as a test dependency, but that would be the easiest way to test this I think. Just trying to pickle StreamWrapper with dill would fail without the code in this PR.

@DanielNoord
Copy link
Contributor Author

Test failures seem unrelated and are due to #330.

@wiggin15
Copy link
Collaborator

LGTM. The checks that didn't pass are unrelated to this change.

I'm merging this but please be aware that since colorama is currently stable and widely use, its release cadence is very slow, so I can't guarantee when this fix will be included in an official release.

@wiggin15 wiggin15 merged commit 51cf507 into tartley:master Mar 29, 2022
@DanielNoord
Copy link
Contributor Author

@wiggin15 Are there any open issues that would help speed up the release of a patch release? I'm not sure how many users use colorama together with pylint, but I would gladly try and see if I can help them by getting a patch release out 😄

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.

Infinite recursion with __getattr__ when pickling/unpickling StreamWrapper (Python 2.7)
2 participants