By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,219 Members | 1,110 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,219 IT Pros & Developers. It's quick & easy.

KeyError

P: n/a
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'
...........................
Thanks for reading this.
R.

Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
ro*******@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
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.