Skip to content

tempfile.SpooledTemporaryFile.encoding is None when the encoding parameter is utf-8 #120

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

Closed
jtrh opened this issue Jun 8, 2020 · 5 comments
Assignees
Labels
bug Something isn't working component: libs

Comments

@jtrh
Copy link
Contributor

jtrh commented Jun 8, 2020

Code: https://github.com/fyntex/lib-cl-sii-python/blob/267c1a55423c7ed6ced718810bb4bd8164b65014/cl_sii/libs/io_utils.py#L61-L63

Test: https://github.com/fyntex/lib-cl-sii-python/blob/267c1a55423c7ed6ced718810bb4bd8164b65014/tests/test_libs_io_utils.py#L70-L73

This issue affects Python 3.7.2, but versions starting from 3.7.6 are not affected.

@jtrh jtrh added the bug Something isn't working label Jun 8, 2020
jtrh added a commit that referenced this issue Jun 8, 2020
@jtrh jtrh changed the title Encoding of SpooledTemporaryFile is None when encoding is UTF-8 Returned encoding of SpooledTemporaryFile is None when encoding parameter is UTF-8 Jun 8, 2020
@jtrh jtrh changed the title Returned encoding of SpooledTemporaryFile is None when encoding parameter is UTF-8 Reported encoding of SpooledTemporaryFile is None when encoding parameter is UTF-8 Jun 8, 2020
@jtrh jtrh changed the title Reported encoding of SpooledTemporaryFile is None when encoding parameter is UTF-8 tempfile.SpooledTemporaryFile.encoding is None when the encoding parameter is utf-8 Jun 8, 2020
jtrh added a commit that referenced this issue Jun 8, 2020
The issue of `tempfile.SpooledTemporaryFile.encoding` being `None` when
the `encoding` parameter is `utf-8` affects only some Python versions.

Ref.: #120
@jtrh jtrh self-assigned this Jul 9, 2020
@jtrh
Copy link
Contributor Author

jtrh commented Jul 9, 2020

@jtrh
Copy link
Contributor Author

jtrh commented Jul 9, 2020

Fixed in python/cpython#17400.

@jtrh jtrh closed this as completed Jul 9, 2020
@glarrain
Copy link
Contributor

glarrain commented Jul 10, 2020

Wow! How did you figure this one out? In which CPython versions (full) was it fixed?

@jtrh
Copy link
Contributor Author

jtrh commented Jul 10, 2020

Wow! How did you figure this one out?

When testing support for Python 3.8 I noticed that the bug wasn't there, and I knew that the bug was present in 3.7.2, so I concluded that the bug was fixed somewhere between those versions. A review of the VCS history of file tempfile.py, focused on class SpooledTemporaryFile, did the rest.

In which CPython versions (full) was it fixed?

The bug was fixed in Python 3.7.6, and is still fixed in 3.8.2.

@glarrain
Copy link
Contributor

Excellent! Expected no less of you ;)

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

No branches or pull requests

2 participants