Skip to content
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

Update environ for CGIHTTPServer.py #37046

Closed
brettcannon opened this issue Aug 16, 2002 · 3 comments
Closed

Update environ for CGIHTTPServer.py #37046

brettcannon opened this issue Aug 16, 2002 · 3 comments
Assignees
Labels
stdlib Python modules in the Lib dir

Comments

@brettcannon
Copy link
Member

BPO 595846
Nosy @gvanrossum, @brettcannon, @rhettinger
Files
  • diff: Contextual diff for CGIHTTPServer.py
  • 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 = 'https://github.com/gvanrossum'
    closed_at = <Date 2002-08-21.00:04:46.000>
    created_at = <Date 2002-08-16.04:26:11.000>
    labels = ['library']
    title = 'Update environ for CGIHTTPServer.py'
    updated_at = <Date 2002-08-21.00:04:46.000>
    user = 'https://github.com/brettcannon'

    bugs.python.org fields:

    activity = <Date 2002-08-21.00:04:46.000>
    actor = 'rhettinger'
    assignee = 'gvanrossum'
    closed = True
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2002-08-16.04:26:11.000>
    creator = 'brett.cannon'
    dependencies = []
    files = ['4518']
    hgrepos = []
    issue_num = 595846
    keywords = ['patch']
    message_count = 3.0
    messages = ['40959', '40960', '40961']
    nosy_count = 3.0
    nosy_names = ['gvanrossum', 'brett.cannon', 'rhettinger']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue595846'
    versions = ['Python 2.2']

    @brettcannon
    Copy link
    Member Author

    This patch causes CGIHTTPServer to update os.environ
    regardless of how it tries to handle calls (fork,
    popen*, etc.).

    I discovered this when trying to run Quixote through
    CGIHTTPServer and getting errors reported by Quixote
    saying that the SCRIPT_NAME environment variable was
    not being updated. I noticed that if self.has_fork was
    true, then os.environ was never explicitly updated;
    os.execve() has the env dict passed to it but I guess
    that is not enough or OS X's os.execve() is broken.

    So this patch just calls os.environ.update(env) after
    the last change to the env dict but before the method
    has decided how it is going to deal with the call. It
    also removes the now extraneous calls previously used.

    @brettcannon brettcannon added the stdlib Python modules in the Lib dir label Aug 16, 2002
    @brettcannon brettcannon added the stdlib Python modules in the Lib dir label Aug 16, 2002
    @gvanrossum
    Copy link
    Member

    Logged In: YES
    user_id=6380

    Thanks! Applied to Python 2.3 in CVS. Somebody can backport
    this to 2.2.2.

    @rhettinger
    Copy link
    Contributor

    Logged In: YES
    user_id=80475

    Backported to 2.2.2.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants