Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '(so': 0.07; 'subject:Error': 0.07; 'subject:getting': 0.07; 'variables': 0.07; 'executed': 0.09; 'indicates': 0.09; 'scripting': 0.09; 'python': 0.11; 'bug': 0.12; 'language.': 0.14; 'windows': 0.15; '"test"': 0.16; 'displaying': 0.16; 'example?': 0.16; 'far)': 0.16; 'fetch': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'idle,': 0.16; 'message- id:@mrabarnett.plus.com': 0.16; 'received:192.168.1.4': 0.16; 'received:84.93': 0.16; 'received:84.93.230': 0.16; 'should.': 0.16; 'fix': 0.17; 'wrote:': 0.18; 'variable': 0.18; 'advance.': 0.19; 'file,': 0.19; 'import': 0.22; 'header:User-Agent:1': 0.23; 'directory.': 0.24; 'environment': 0.24; 'script': 0.25; 'header :In-Reply-To:1': 0.27; 'installed': 0.27; 'point': 0.28; 'function': 0.29; "i'm": 0.30; 'getting': 0.31; 'cgi': 0.31; 'correctly.': 0.31; 'directly,': 0.31; 'directory,': 0.31; 'skip:= 20': 0.31; 'them?': 0.31; 'file': 0.32; 'run': 0.32; 'running': 0.33; 'could': 0.34; 'problem': 0.35; 'created': 0.35; 'problem.': 0.35; 'anybody': 0.35; 'beyond': 0.35; 'good.': 0.35; 'received:84': 0.35; 'but': 0.35; 'there': 0.35; 'words,': 0.36; 'thanks': 0.36; 'should': 0.36; 'being': 0.38; 'server': 0.38; 'to:addr:python-list': 0.38; 'fact': 0.38; 'anything': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'called': 0.40; 'how': 0.40; 'skip:u 10': 0.60; 'interested,': 0.61; 'browser': 0.61; 'entire': 0.61; 'simple': 0.61; "you're": 0.61; 'back': 0.62; 'here': 0.66; 'home': 0.69; 'click': 0.77 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=JLW1sq6b c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=sASEtNAQL0YA:10 a=PGH-aOuFSSIA:10 a=ihvODaAuJD4A:10 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=JQMUgATHonYA:10 a=NoAqmy_JGhP-SC5IEQoA:9 a=QEXdDO2ut3YA:10 X-AUTH: mrabarnett:2500 Date: Thu, 20 Feb 2014 15:33:58 +0000 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Error getting REMOTE_USER Environment Variable References: <3fVJjc71dFz7LjN@mail.python.org> In-Reply-To: <3fVJjc71dFz7LjN@mail.python.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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: 44 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1392910441 news.xs4all.nl 2972 [2001:888:2000:d::a6]:56885 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:66761 On 2014-02-20 14:53, Hobie Audet wrote: > I'm running the Abyss Web Server X1 (v 2.9.0.1) on a Windows XP Home > (SP3) system and am using Python 3.3 for a scripting language. I'm > having a problem getting the environment variable "REMOTE_USER". Here's > the situation: > > 1. I have created a user under Abyss. The userid is "userxyz".. > 2. I have created a directory under htdocs called "Test" and using the > Abyss console I have password protected it. > 3. In the "Test" directory, there is no "index.html" file but there is > an "index.py" file, so that should get executed when I access the "Test" > directory. > 4. If I start up my web browser and point it to "localhost/Test", I get > challenged for user authentication, as I should. > 5. I enter the userid ("userxyz") and its password and click the "Log > in" button. Authentication succeeds. So far, so good. > 6. The "index.py" script is launched. It's only function (so far) is > to fetch the "REMOTE_USER" environment variable and echo it back to me. > 7. What it echoes back is "userxyzuserxyz". In other words, the > REMOTE_USER value is repeated. > > In case you're interested, here is the entire "index.py" script: > > import os > userid =os.environ["REMOTE_USER"] > print("Content-type: text/html") > print() > print("" + userid + " > That's about as simple as anything could be. The fact that the script > is displaying anything at all indicates to me that my Python cgi support > is installed correctly and that the script is being executed correctly. > By why the "REMOTE_USER" value is doubled is beyond my understanding. > Is this a bug in the os package that comes with Python 3.3? Anybody > got a fix for it? > > By the way, if I try to fetch "AUTH_USER", I get the same problem. > > Thanks in advance. > How many other environment variables are doubled? All of them? Does the problem exist when the Python script is run directly, outside Abyss, or in IDLE, for example?