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 — The search for pyvenv.cfg doesn't match PEP 405 · Issue #77483 · python/cpython

The search for pyvenv.cfg doesn't match PEP 405 #77483

New issue
Copy link
New issue
Copy link
Closed
Closed
The search for pyvenv.cfg doesn't match PEP 405#77483
Copy link
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

mattheww
mannequin
opened on Apr 17, 2018
Issue body actions
BPO 33302
Nosy @mattheww

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 2018-04-17.21:48:27.965>
labels = ['interpreter-core', 'type-bug', '3.7']
title = "The search for pyvenv.cfg doesn't match PEP 405"
updated_at = <Date 2018-04-17.21:48:27.965>
user = 'https://github.com/mattheww'

bugs.python.org fields:

activity = <Date 2018-04-17.21:48:27.965>
actor = 'mattheww'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Interpreter Core']
creation = <Date 2018-04-17.21:48:27.965>
creator = 'mattheww'
dependencies = []
files = []
hgrepos = []
issue_num = 33302
keywords = []
message_count = 1.0
messages = ['315424']
nosy_count = 1.0
nosy_names = ['mattheww']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue33302'
versions = ['Python 3.5', 'Python 3.6', 'Python 3.7']

Activity

  1. mattheww commented on Apr 17, 2018

    @mattheww
    matthewwmannequin
    on Apr 17, 2018
    MannequinAuthor
    More actions

    PEP-405 says that the pyvenv.cfg file is found as follows:

    « a pyvenv.cfg file is found either adjacent to the Python executable or one directory above it (if the executable is a symlink, it is not dereferenced), »

    But in cpython if the executable is a symlink, it _is_ dereferenced before searching for pyvenv.cfg .

    I've checked this behaviour with Python 3.5, 3.6, and today's 3.7 tip.

    Looking in 3.7's getpath.c, calculate_path_impl() calls, in order:

       calculate_program_full_path()
       calculate_argv0_path()
       calculate_read_pyenv()

    It looks like the symlink resolution happens near the end of calculate_argv0_path().

    I think this means that the 'home=' line in pyvenv.cfg files generated by the 'venv' module is irrelevant (and seems likely to confuse anyone who might try to construct a Python environment by imitating a built venv).

  2. mattheww
    added
    3.7 (EOL)end of lifeend of life
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Apr 17, 2018
  3. ezio-melotti
    transferred this issue fromon Apr 10, 2022
  4. mattheww commented on Sep 6, 2026

    @mattheww
    mattheww
    on Sep 6, 2026
    Author
    More actions

    I think this was fixed by #29041 (for Python 3.11) and Python now behaves as PEP 405 said it should.

    Reacted by Bénédikt Tran
  5. picnixz
    removed
    3.7 (EOL)end of lifeend of life
    on Sep 6, 2026
  6. picnixz
    closed this as completedon Sep 6, 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

    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    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.