GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-44647: Fix test_httpservers failing on Unicode characters in os.environ on Windows by ambv · Pull Request #27161 · python/cpython

Conversation

@ambv

@ambv ambv commented Jul 15, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ambv ambv added OS-windows DO-NOT-MERGE labels Jul 15, 2021
@bedevere-bot bedevere-bot added the awaiting core review label Jul 15, 2021
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Jul 15, 2021
@bedevere-bot bedevere-bot added the tests Tests in the Lib/test dir label Jul 15, 2021
@ambv ambv added skip issue skip news labels Jul 15, 2021
@ambv ambv mentioned this pull request Jul 15, 2021
bpo-42073: allow classmethod to wrap other classmethod-like descriptors #27115
Merged
@ambv
ambv requested a review from a team as a code owner July 15, 2021 13:14
@ambv

ambv commented Jul 15, 2021

Copy link
Copy Markdown
Contributor Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ambv

ambv commented Jul 15, 2021

Copy link
Copy Markdown
Contributor Author

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'

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ambv added 3 commits July 15, 2021 16:44
@ambv
[DO-NOT-MERGE] Debug Azure Pipelines Accept: (see pythonGH-27115)
18cd4c2
@ambv
Disable Windows-specific mimetypes
00e6c4e
@ambv
Revert mimetypes change, test with content-type: text/html
fbbb3c3
@ambv
ambv force-pushed the debug-azure-pipelines-accept branch from db40e30 to fbbb3c3 Compare July 15, 2021 14:45
@ambv

ambv commented Jul 15, 2021

Copy link
Copy Markdown
Contributor Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ambv added 3 commits July 15, 2021 17:10
@ambv
Try repr(os.environ)
8cceb8b
@ambv
Use str() since os.environ is test.support.os_helper.EnvironmentVarGu…
0bf4ed0
…ard in

tests.
@ambv
dict(os.environ)
94020ec
@ambv

ambv commented Jul 15, 2021

Copy link
Copy Markdown
Contributor Author

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

IvanLauLinTiong and hugovk reacted with thumbs up emoji sco1, graingert, anentropic, RenGeng, hugovk, PengZheng, marcinjosinski, JelleZijlstra, and StefanBrand reacted with laugh emoji
All reactions
  • 👍 2 reactions
  • 😄 9 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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
Fix test for unaccounted for Unicode characters in environment
197f9bd
@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 removed DO-NOT-MERGE skip issue labels Jul 15, 2021
pablogsal
pablogsal approved these changes Jul 15, 2021
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Jul 15, 2021
@ambv
ambv merged commit 82b218f into python:main Jul 15, 2021
@bedevere-bot bedevere-bot removed the awaiting merge label 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 labels Jul 15, 2021
@miss-islington

miss-islington commented Jul 15, 2021

Copy link
Copy Markdown
Contributor

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington

miss-islington commented Jul 15, 2021

Copy link
Copy Markdown
Contributor

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot

bedevere-bot commented Jul 15, 2021

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the needs backport to 3.10 label Jul 15, 2021
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 15, 2021
@ambv @miss-islington
bpo-44647: Fix test_httpservers failing on Unicode characters in os.e…
002d862
…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 <[email protected]>
@bedevere-bot bedevere-bot removed the needs backport to 3.9 label Jul 15, 2021
@bedevere-bot

bedevere-bot commented Jul 15, 2021

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 15, 2021
@ambv @miss-islington
bpo-44647: Fix test_httpservers failing on Unicode characters in os.e…
4500268
…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 <[email protected]>
ambv added a commit that referenced this pull request Jul 15, 2021
@miss-islington @ambv
bpo-44647: Fix test_httpservers failing on Unicode characters in os.e…
356bdff
…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 <[email protected]>
ambv added a commit that referenced this pull request Jul 15, 2021
@miss-islington @ambv
bpo-44647: Fix test_httpservers failing on Unicode characters in os.e…
95596d5
…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 <[email protected]>
@pablogsal pablogsal mentioned this pull request Jul 18, 2021
[3.10] Correct the order of regen-abidump #27228
Closed
@ambv ambv mentioned this pull request Apr 25, 2022
Non-ASCII characters in os.environ cause silent failures in test_httpservers #88813
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@pablogsal pablogsal pablogsal approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

OS-windows skip news tests Tests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@ambv @miss-islington @bedevere-bot @pablogsal @the-knights-who-say-ni
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.