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

Simplify EncodedFile.__getattr__ #2614

Closed

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Jul 25, 2017

@blueyed
Copy link
Contributor Author

blueyed commented Jul 25, 2017

Required for pickling?!

    def test_pickling_and_unpickling_enocded_file():
        # See https://bitbucket.org/pytest-dev/pytest/pull-request/194
        # pickle.loads() raises infinite recursion if
        # EncodedFile.__getattr__ is not implemented properly
        ef = capture.EncodedFile(None, None)
        ef_as_str = pickle.dumps(ef)
>       pickle.loads(ef_as_str)

testing/test_capture.py:1151: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py36/lib/python3.6/site-packages/_pytest/capture.py:258: in __getattr__
    return getattr(self.buffer, name)
.tox/py36/lib/python3.6/site-packages/_pytest/capture.py:258: in __getattr__
    return getattr(self.buffer, name)
.tox/py36/lib/python3.6/site-packages/_pytest/capture.py:258: in __getattr__
    return getattr(self.buffer, name)
E   RecursionError: maximum recursion depth exceeded while calling a Python object
!!! Recursion detected (same locals & position)

@blueyed blueyed closed this Jul 25, 2017
@blueyed blueyed deleted the simplify_encodedfile.__getattr__ branch July 25, 2017 16:19
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.

1 participant