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

[s3] Fix newlines test for python 3.11 and above #1400

Merged

Conversation

skim618
Copy link

@skim618 skim618 commented May 9, 2024

Fixes #1381 CI Failures for Python 3.11 and above

SpooledTemporaryFile introduced new changes in 3.11 (https://docs.python.org/3/library/tempfile.html)
It now fully implements the io.BufferedIOBase and io.TextIOBase abstract base classes allowing the file
to be readable in the mode that it was specified (without accessing the underlying ._file object).

It seems like wrapping the underlying ._file is forbidden for versions 3.11 and higher (results in the ValueError)
Having two have separate methods for different versions isn't the prettiest fix but should suffice.

SpooledTemporaryFile introduced new changes in 3.11 (https://docs.python.org/3/library/tempfile.html)
It now fully implements the io.BufferedIOBase and io.TextIOBase abstract base classes allowing the file
to be readable in the mode that it was specified (without accessing the underlying ._file object).

It seems like wrapping the underlying ._file is forbidden for versions 3.11 and higher (results in the ValueError)
Having two have separate methods for different versions isn't the prettiest fix but should suffice.
@jschneier jschneier merged commit 0965403 into jschneier:josh/s3-fix-newlines May 10, 2024
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.

None yet

2 participants