Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #66757

Error getting REMOTE_USER Environment Variable

Date 2014-02-20 09:53 -0500
From Hobie Audet <Hobie.Audet@comcast.net>
Subject Error getting REMOTE_USER Environment Variable
Newsgroups comp.lang.python
Message-ID <mailman.7186.1392908069.18130.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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("<HTML><BODY>" + userid + "</BODY></HTML")

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.

Hobie Audet  

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Error getting REMOTE_USER Environment Variable Hobie Audet <Hobie.Audet@comcast.net> - 2014-02-20 09:53 -0500
  Re: Error getting REMOTE_USER Environment Variable John Gordon <gordon@panix.com> - 2014-02-20 16:19 +0000

csiph-web