473,503 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

KeyError

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
1 5299
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1611
by: Norman Shelley | last post by:
Is there a way to get at the object one is trying to access with a key to list out all the possible keys? See the except clause below. #!/usr/bin/env python2.2 from inspect import * import sys...
3
5082
by: Rune Strand | last post by:
I'm experiencing strange errors both with pickle and cPickle in the below code: import cPickle as pickle #import pickle from string import ascii_uppercase from string import ascii_lowercase...
4
8022
by: homepricemaps | last post by:
i have an href which looks like this: <td class="all"> <a class="btn" name="D1" href="http://www.cnn.com"> </a> here is my code
0
1882
by: John Salerno | last post by:
I'm trying to use a for loop with a FieldStorage object and I get the following error. Can you not treat it like a dictionary, or am I writing the for loop incorrectly? for item in form: print...
3
3961
by: nyenyec | last post by:
urllib.quote chokes on unicode in 2.4.4. 2.4.4 (#1, Oct 18 2006, 10:34:39) Traceback (most recent call last): File "<stdin>", line 1, in ? File...
5
1490
by: rconradharris | last post by:
A co-worker of mine came across some interesting behavior in the Python interpreter today and I'm hoping someone more knowledgeable in Python internals can explain this to me. First, we create...
3
12838
GTXY20
by: GTXY20 | last post by:
Hello, Any comments on the below mentioned problem are most appreciated. I have a function and it is throwing this error: FEXpython_v2.py", line 32, in UnitHolderDistributionqty ...
2
7829
by: christof | last post by:
Hi, I am using pickle/unpickle to let my program save its documents to disk. While this it worked stable for a long time, one of my users now complained, that he had a file which can't be...
6
55540
by: josh001 | last post by:
I'm trying to figure out why KeyError: 0 pops up when I try to run the program containing the code. OpenDLG = wx.FileDialog( self.win, message='Please choose...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7353
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7011
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7468
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5023
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4689
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3170
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
401
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.