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


Groups > comp.lang.python > #66761 > unrolled thread

Re: Error getting REMOTE_USER Environment Variable

Started byMRAB <python@mrabarnett.plus.com>
First post2014-02-20 15:33 +0000
Last post2014-02-20 15:33 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Error getting REMOTE_USER Environment Variable MRAB <python@mrabarnett.plus.com> - 2014-02-20 15:33 +0000

#66761 — Re: Error getting REMOTE_USER Environment Variable

FromMRAB <python@mrabarnett.plus.com>
Date2014-02-20 15:33 +0000
SubjectRe: Error getting REMOTE_USER Environment Variable
Message-ID<mailman.7189.1392910441.18130.python-list@python.org>
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("<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.
>
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?

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web