Issue1728431

classification
Title: AttributeError: __getitem__ in httplib.py
Type: Severity: normal
Components: Library Versions:
Milestone:
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: cgroves, gwynevans, pekka.klarck
Priority: normal Keywords:

Created on 2007-05-30.16:21:25 by gwynevans, last changed 2007-07-25.14:30:59 by gwynevans.

Messages
msg1621 (view) Author: Gwyn Evans (gwynevans) Date: 2007-05-30.16:21:25
Not 100% sure what the error is here, but thought I'd flag it in case it was something that should be looked at...

When connecting to a XML-RPC server that's immediately closing it's input socket, I enabled debug in the httplib as below:

import httplib
httplib.HTTPConnection.debuglevel = 1

which resulted in the following error:

Traceback (innermost last):
  File "Air_GetBal.py", line 17, in ?
  File "/export/home/topup/jython2.2b2/Lib/xmlrpclib.py", line 824, in __call__
  File "/export/home/topup/jython2.2b2/Lib/xmlrpclib.py", line 974, in _ServerProxy__request
  File "/export/home/topup/jython2.2b2/Lib/xmlrpclib.py", line 843, in request
  File "/export/home/topup/jython2.2b2/Lib/xmlrpclib.py", line 881, in send_content
  File "/export/home/topup/jython2.2b2/Lib/httplib.py", line 566, in send
AttributeError: __getitem__

Interestingly, I don't enable the debugging, I get different behaviour and see the following instead...

Traceback (innermost last):
  File "Air_GetBal.py", line 17, in ?
  File "/export/home/topup/jython2.2b2/Lib/xmlrpclib.py", line 824, in __call__
  File "/export/home/topup/jython2.2b2/Lib/xmlrpclib.py", line 974, in _ServerProxy__request
  File "/export/home/topup/jython2.2b2/Lib/xmlrpclib.py", line 845, in request
  File "/export/home/topup/jython2.2b2/Lib/httplib.py", line 1013, in getreply
  File "/export/home/topup/jython2.2b2/Lib/httplib.py", line 764, in getresponse
  File "/export/home/topup/jython2.2b2/Lib/httplib.py", line 273, in begin
  File "/export/home/topup/jython2.2b2/Lib/httplib.py", line 231, in _read_status
IOError: Connection reset
 
msg1622 (view) Author: Gwyn Evans (gwynevans) Date: 2007-05-30.16:31:16
Just noticed 229368, which looks to be the same underlying issue (although I don't understand the significance of needing to enable the debug in this particular case).
msg1623 (view) Author: Charlie Groves (cgroves) Date: 2007-07-25.06:45:34
Closing as a dupe.
msg1624 (view) Author: Pekka Klärck (pekka.klarck) Date: 2007-07-25.08:09:16
Gwyn, could run your code usingJython 2.2 rc 2 (or newer if available)? New socket module ought to fix the underlying problem in this case (old bug you referenced is not closed) and it would be interesting to know are there other issues in httplib.
msg1625 (view) Author: Gwyn Evans (gwynevans) Date: 2007-07-25.14:30:59
I'm afraid that I don't have access to the (third-party) server I was using at the moment, but I'll bear it in mind if I am in a position to be able to try it in the future. 
History
Date User Action Args
2007-05-30 16:21:25gwynevanscreate