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 — sysconfig should not rely on sys.version · Issue #81773 · python/cpython

sysconfig should not rely on sys.version #81773

New issue
Copy link
New issue
Copy link
Closed
Closed
sysconfig should not rely on sys.version#81773
Copy link
Labels
3.9 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

Description

carlbordum
mannequin
opened on Jul 14, 2019
Issue body actions
BPO 37592
Nosy @tarekziade, @carlbordum
PRs
  • bpo-37592: sysconfig no longer relies on sys.version #14776
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2019-07-14.14:18:09.238>
    labels = ['type-feature', 'library', '3.9']
    title = 'sysconfig should not rely on sys.version'
    updated_at = <Date 2019-07-14.14:20:50.854>
    user = 'https://github.com/carlbordum'

    bugs.python.org fields:

    activity = <Date 2019-07-14.14:20:50.854>
    actor = 'carlbordum'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2019-07-14.14:18:09.238>
    creator = 'carlbordum'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37592
    keywords = ['patch']
    message_count = 1.0
    messages = ['347916']
    nosy_count = 2.0
    nosy_names = ['tarek', 'carlbordum']
    pr_nums = ['14776']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue37592'
    versions = ['Python 3.9']

    Linked PRs

    • gh-81773: Avoid parsing sys.version string in sysconfig #146149

    Activity

    1. carlbordum commented on Jul 14, 2019

      @carlbordum
      carlbordummannequin
      on Jul 14, 2019
      MannequinAuthor
      More actions

      I found this FIXME and replaced it with code that follows the git tags naming scheme.

    2. carlbordum
      added
      3.9 (EOL)end of lifeend of life
      stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
      type-featureA feature request or enhancementA feature request or enhancement
      on Jul 14, 2019
    3. ezio-melotti
      transferred this issue fromon Apr 10, 2022
    4. mattip commented on Nov 16, 2022

      @mattip
      mattip
      on Nov 16, 2022
      Contributor
      More actions

      PR #14776 was closed, deferring to PR #24644 so I think this issue should be closed.

    5. FFY00 commented on Nov 21, 2022

      @FFY00
      FFY00
      on Nov 21, 2022
      Member
      More actions

      No, it is still used to calculate _PY_VERSION, and is also used in get_platform, which the original PR did not touch. I don't think it's a huge issue, but as the documentation advises us to not extract information from it, we should replace such usages.

    6. FFY00 commented on Nov 21, 2022

      @FFY00
      FFY00
      on Nov 21, 2022
      Member
      More actions

      cpython/Lib/sysconfig.py

      Line 169 in 6d8da23

      _PY_VERSION = sys.version.split()[0]

      cpython/Lib/sysconfig.py

      Lines 765 to 770 in 6d8da23

      if 'amd64' in sys.version.lower():
      return 'win-amd64'
      if '(arm)' in sys.version.lower():
      return 'win-arm32'
      if '(arm64)' in sys.version.lower():
      return 'win-arm64'

    7. vstinner commented on Mar 19, 2026

      @vstinner
      vstinner
      on Mar 19, 2026
      Member
      More actions
       if 'amd64' in sys.version.lower(): 
           return 'win-amd64' 
       if '(arm)' in sys.version.lower(): 
           return 'win-arm32' 
       if '(arm64)' in sys.version.lower(): 
           return 'win-arm64' 

      I removed this code in PR gh-146145 which adds _sysconfig.get_platform() on Windows.

      The last line using sys.version in sysconfig is: _PY_VERSION = sys.version.split()[0].

    8. vstinner
      added a commit that references this issue on Mar 19, 2026

      pythongh-81773: Avoid parsing sys.version string in sysconfig

      072673a
    9. vstinner commented on Mar 19, 2026

      @vstinner
      vstinner
      on Mar 19, 2026
      Member
      More actions

      I created #146149 to add _sysconfig._PY_VERSION.

    10. vstinner commented on Mar 26, 2026

      @vstinner
      vstinner
      on Mar 26, 2026
      Member
      More actions

      @FFY00:

      No, it is still used to calculate _PY_VERSION, and is also used in get_platform, which the original PR did not touch. I don't think it's a huge issue, but as the documentation advises us to not extract information from it, we should replace such usages.

      I wrote #146149 but I'm not sure that this change is worth it. _PY_VERSION = sys.version.split()[0] just works. I prefer to just close this issue.

      Reopen it if you consider that sysconfig should really not parse sys.version string (to set _PY_VERSION).

    11. vstinner
      closed this as completedon Mar 26, 2026
    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

      3.9 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

      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.