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 — Document that `os.environ` forcibly upper-cases keys on case-insensitive OSs · Issue #101754 · python/cpython

Document that os.environ forcibly upper-cases keys on case-insensitive OSs #101754

New issue
Copy link
New issue
Copy link
Closed
#101840
Closed
Document that os.environ forcibly upper-cases keys on case-insensitive OSs#101754
#101840
Copy link
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir

Description

@brettcannon
brettcannon
opened on Feb 9, 2023
Issue body actions

Documentation

os.environ docs don't mention that the keys get upper-cased automatically on e.g. Windows.

Linked PRs

  • gh-101754: document that on Windows, keys in os.environ are converted to uppercase #101840
  • [3.10] gh-101754: Document that Windows converts keys in os.environ to uppercase (GH-101840) #102393
  • [3.11] gh-101754: Document that Windows converts keys in os.environ to uppercase (GH-101840) #102394
Reacted by Kartik Raj
Reacted by Kartik Raj

Activity

  1. brettcannon
    added
    docsDocumentation in the Doc dirDocumentation in the Doc dir
    on Feb 9, 2023
  2. brettcannon commented on Feb 9, 2023

    @brettcannon
    brettcannon
    on Feb 9, 2023
    MemberAuthor
    More actions

    This came up when using Python to read the environment then trying to merge the results with Node's environment variable APIs which do not normalize.

  3. karrtikr commented on Feb 9, 2023

    @karrtikr
    karrtikr
    on Feb 9, 2023
    More actions

    Source code:

    cpython/Lib/os.py

    Line 755 in f1f3af7

    return encode(key).upper()

  4. eryksun commented on Feb 9, 2023

    @eryksun
    eryksun
    on Feb 9, 2023
    Contributor
    More actions

    Note that it wouldn't be hard to make os.environ case insensitive but case preserving, starting with Python 3.12 or 3.13. I discussed a possible implementation in issue #73010.

  5. OTheDev commented on Feb 11, 2023

    @OTheDev
    OTheDev
    on Feb 11, 2023
    Contributor
    More actions

    Thoughts on the following (third note) suggested fix?

    fix

    EDIT: on second thought, I think I prefer

    fix3

  6. zooba
    closed this as completedin #101840on Mar 3, 2023
  7. zooba
    added a commit that references this issue on Mar 3, 2023

    gh-101754: Document that Windows converts keys in `os.environ` to upp…

    4e7c0cb
  8. miss-islington
    added 4 commits that reference this issue on Mar 3, 2023

    pythongh-101754: Document that Windows converts keys in `os.environ` …

    755862e

    pythongh-101754: Document that Windows converts keys in `os.environ` …

    6082c4f

    gh-101754: Document that Windows converts keys in `os.environ` to upp…

    3d88b4e

    gh-101754: Document that Windows converts keys in `os.environ` to upp…

    32a738e
  9. carljm
    added a commit that references this issue on Mar 4, 2023

    Merge branch 'main' into nodeaddict

    a31af32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dirDocumentation in the Doc dir

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — 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.