Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.024 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'cc:addr:python-list': 0.11; 'python': 0.11; '2.7.2': 0.16; 'from:addr:pobox.com': 0.16; 'from:addr:skip': 0.16; 'subject:effect': 0.16; 'sender:addr:gmail.com': 0.17; '>>>': 0.22; 'import': 0.22; 'cc:addr:python.org': 0.22; 'skip': 0.24; 'environment': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'header:In-Reply- To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'could': 0.34; 'anybody': 0.35; 'received:google.com': 0.35; 'doing': 0.36; 'skip:o 20': 0.38; 'does': 0.39; 'affect': 0.61; 'happen': 0.63; 'more': 0.64 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=ydcJK2lZ3bO04biI2XZLfVY2ijPZh0QzNSmt0cHeVTE=; b=PnDPOKZBm+Gd0++oz0CATWqJgKkkUdxBv5oNbodq9vtDR/J2kDjug9a6PtRCD9gnGW LhR3GPyRK683lc03WLVR/EYCl2uez4nH0LPzyG1xHy8y1fCoinLDAWMPxv4hHmmKi7go i0FGvgQk2l7527H4WJ83FoTRKird6AVSSwyGBLykn8gj468Z1QoPmenuOp6HU5IZj31f 2mkF/BzByrpYyEnIWFT2Jy/Prpy5/cbkEaKX+vqhHNFMWoLjXT9QOUdms3xcI62OEeKE qoVH6zWACA+kQdZFzoEXyMr6woxOQO4L5/TsaHSbgYENY5O2vOKRb/lEBpZgEuHTGW8d 64qg== MIME-Version: 1.0 X-Received: by 10.50.97.6 with SMTP id dw6mr8035334igb.94.1371579768205; Tue, 18 Jun 2013 11:22:48 -0700 (PDT) Sender: skip.montanaro@gmail.com In-Reply-To: References: Date: Tue, 18 Jun 2013 13:22:48 -0500 X-Google-Sender-Auth: 7xmaVpPhOWjNrPQE3IKywVLhnQA Subject: Re: os.putenv() has no effect From: Skip Montanaro To: Johannes Bauer Content-Type: text/plain; charset=UTF-8 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371579771 news.xs4all.nl 15877 [2001:888:2000:d::a6]:39978 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:48656 > Does anybody know why this would happen or what I could be doing wrong? os.putenv will only affect the environment in subprocesses. Consider this session fragment: % python Python 2.7.2 (default, Oct 17 2012, 03:11:33) [GCC 4.4.6 [TWW]] on sunos5 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.putenv("PATH", "/tmp") >>> os.system("/usr/bin/env") ... PATH=/tmp ... Skip