Skip to content

bpo-44647: Fix test_httpservers failing on Unicode characters in os.environ on Windows #27161

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

Merged
merged 7 commits into from
Jul 15, 2021

Conversation

ambv
Copy link
Contributor

@ambv ambv commented Jul 15, 2021

GH-23638 introduced a new test for Accept: headers in CGI HTTP servers. This test serializes all of os.environ on the server side. For non-UTF8 locales this can fail for some Unicode characters found in environment variables. This change fixes the HTTP_ACCEPT test.

Check the issue for more details, and the comments in this PR for hunting the root cause down. This was first encountered when working on GH-27115.

https://bugs.python.org/issue44647

@ambv
Copy link
Contributor Author

ambv commented Jul 15, 2021

Disabling db.read_windows_registry() in mimetypes.py didn't change anything here. Another attempt will be to change the result type from text/plain to text/html.

@ambv
Copy link
Contributor Author

ambv commented Jul 15, 2021

Looks like this is an Azure Pipelines problem. All the passing PRs that don't trip over test_httpservers are running on:

Current image version: '20210628.1'

While all the PRs that fail in test_httpservers are running on:

Current image version: '20210711.1'

@ambv ambv force-pushed the debug-azure-pipelines-accept branch from db40e30 to fbbb3c3 Compare July 15, 2021 14:45
@ambv
Copy link
Contributor Author

ambv commented Jul 15, 2021

OK, back to square one. There are newer PRs on image 20210711.1 that pass. Knowing my luck, the failures are because my name is Łukasz.

@ambv
Copy link
Contributor Author

ambv commented Jul 15, 2021

Knowing my luck, the failures are because my name is Łukasz.

THIS WAS SUPPOSED TO BE A JOKE

Screenshot 2021-07-15 at 19 35 45

I filed https://bugs.python.org/issue44647

@ambv ambv changed the title [DO-NOT-MERGE] Debug Azure Pipelines Accept: (see GH-27115) [DO-NOT-MERGE] bpo-44647: Debug Azure Pipelines Accept: (see GH-27115) Jul 15, 2021
@ambv ambv changed the title [DO-NOT-MERGE] bpo-44647: Debug Azure Pipelines Accept: (see GH-27115) bpo-44647: Debug Azure Pipelines Accept: (see GH-27115) Jul 15, 2021
@ambv ambv changed the title bpo-44647: Debug Azure Pipelines Accept: (see GH-27115) bpo-44647: Fix test_httpservers failing on Unicode characters in os.environ on Windows (see GH-27115) Jul 15, 2021
@ambv ambv changed the title bpo-44647: Fix test_httpservers failing on Unicode characters in os.environ on Windows (see GH-27115) bpo-44647: Fix test_httpservers failing on Unicode characters in os.environ on Windows Jul 15, 2021
@ambv ambv merged commit 82b218f into python:main Jul 15, 2021
@ambv ambv deleted the debug-azure-pipelines-accept branch July 15, 2021 19:14
@ambv ambv added needs backport to 3.9 only security fixes needs backport to 3.10 only security fixes labels Jul 15, 2021
@miss-islington
Copy link
Contributor

Thanks @ambv for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Thanks @ambv for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-27169 is a backport of this pull request to the 3.10 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Jul 15, 2021
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 15, 2021
…nviron on Windows (pythonGH-27161)

pythonGH-23638 introduced a new test for Accept: headers in CGI HTTP servers. This test serializes all of os.environ on the server side. For non-UTF8 locales this can fail for some Unicode characters found in environment variables. This change fixes the HTTP_ACCEPT test.
(cherry picked from commit 82b218f)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
@bedevere-bot bedevere-bot removed the needs backport to 3.9 only security fixes label Jul 15, 2021
@bedevere-bot
Copy link

GH-27170 is a backport of this pull request to the 3.9 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 15, 2021
…nviron on Windows (pythonGH-27161)

pythonGH-23638 introduced a new test for Accept: headers in CGI HTTP servers. This test serializes all of os.environ on the server side. For non-UTF8 locales this can fail for some Unicode characters found in environment variables. This change fixes the HTTP_ACCEPT test.
(cherry picked from commit 82b218f)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
ambv added a commit that referenced this pull request Jul 15, 2021
…nviron on Windows (GH-27161) (#27169)

GH-23638 introduced a new test for Accept: headers in CGI HTTP servers. This test serializes all of os.environ on the server side. For non-UTF8 locales this can fail for some Unicode characters found in environment variables. This change fixes the HTTP_ACCEPT test.
(cherry picked from commit 82b218f)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
ambv added a commit that referenced this pull request Jul 15, 2021
…nviron on Windows (GH-27161) (#27170)

GH-23638 introduced a new test for Accept: headers in CGI HTTP servers. This test serializes all of os.environ on the server side. For non-UTF8 locales this can fail for some Unicode characters found in environment variables. This change fixes the HTTP_ACCEPT test.
(cherry picked from commit 82b218f)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-windows skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants