Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #66757 > unrolled thread
| Started by | Hobie Audet <Hobie.Audet@comcast.net> |
|---|---|
| First post | 2014-02-20 09:53 -0500 |
| Last post | 2014-02-20 16:19 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.python
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
| From | Hobie Audet <Hobie.Audet@comcast.net> |
|---|---|
| Date | 2014-02-20 09:53 -0500 |
| Subject | Error getting REMOTE_USER Environment Variable |
| Message-ID | <mailman.7186.1392908069.18130.python-list@python.org> |
[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
[toc] | [next] | [standalone]
| From | John Gordon <gordon@panix.com> |
|---|---|
| Date | 2014-02-20 16:19 +0000 |
| Message-ID | <le59tn$im6$1@reader1.panix.com> |
| In reply to | #66757 |
In <mailman.7186.1392908069.18130.python-list@python.org> Hobie Audet <Hobie.Audet@comcast.net> writes: > 7. What it echoes back is "userxyzuserxyz". In other words, the > REMOTE_USER value is repeated. What username is recorded in the access_log file? > 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? If there is a bug, it's much more likely to be in the webserver code that sets the REMOTE_USER value. -- John Gordon Imagine what it must be like for a real medical doctor to gordon@panix.com watch 'House', or a real serial killer to watch 'Dexter'.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web