KeyError

Diez B. Roggisch deetsNOSPAM at web.de
Wed Dec 15 08:58:34 EST 2004


rootshell at gazeta.pl wrote:

> Hello.
> Maybe someone will help me with this KeyError:
> 
> ............................
> Traceback (most recent call last):
>   File "C:\Python\tabla.py", line 929, in -toplevel-
>     tablesDirectory = tablesDirectoryPrefix + os.environ['REMOTE_ADDR']
>   File "C:\Python23\lib\os.py", line 417, in __getitem__
>     return self.data[key.upper()]
> KeyError: 'REMOTE_ADDR'
> ..........................

That tabla.py of yours is certainly to be executed in a CGI environment. So
call it that way - or provide the neccessary environment by stuffing values
to os.environ


-- 
Regards,

Diez B. Roggisch



More information about the Python-list mailing list