[Python-bugs-list] [ python-Bugs-405427 ] SQL2000+XML returns "400.100" status

nobody nobody@sourceforge.net
Sun, 04 Mar 2001 09:00:33 -0800


Bugs #405427, was updated on 2001-03-02 05:32
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=405427&group_id=5470

Category: Python Library
Group: Feature Request
Status: Open
Priority: 4
Submitted By: Luke Kenneth Casson Leighton
Assigned to: Jeremy Hylton
Summary: SQL2000+XML returns "400.100" status

Initial Comment:
httplib.py expects status codes to be "integers" - of
the form 400, 200, 502 etc etc.

if you run the SQL 2000 server with its XML interface
which is accessed over HTTP, and you do an invalid
query, the HTTP response code is "400.100".  the line
that says self.status = status = int(status) freaks out
and says, erk, can't convert status of value 400.100 to
an integer.

----------------------------------------------------------------------

Comment By: Martin v. Löwis
Date: 2001-03-04 09:00

Message:
Logged In: YES 
user_id=21627

A patch for this bug is available at
https://sourceforge.net/tracker/index.php?func=detail&aid=405845&group_id=5470&atid=305470

----------------------------------------------------------------------

Comment By: Martin v. Löwis
Date: 2001-03-04 08:33

Message:
Logged In: YES 
user_id=21627

I originally proposed that the current behaviour is fine: If
the other end violates the protocol, you get an exception.
In further review, I find that raising BadStatusLine might
be more appropriate. I'll try to come up with a patch.

----------------------------------------------------------------------

Comment By: Fred L. Drake, Jr.
Date: 2001-03-04 07:50

Message:
Logged In: YES 
user_id=3066

I wasn't suggesting that this was a problem with your application code; this is clearly a problem with the SQL2000 server.  It has nothing to do with either HTML or XML, only the transport mechanism (HTTP).  Both HTTP/1.0 and HTTP/1.1 define the response code to be three digits.

The issue for httplib is how best to handle the error; I'm not sure what the best way is.  You certainly are suggesting that the current behavior isn't quite right for working with the SQL2000 server.

----------------------------------------------------------------------

Comment By: Luke Kenneth Casson Leighton
Date: 2001-03-04 06:10

Message:
Logged In: YES 
user_id=80200

ha ha, surely you jest: you expect ms to conform fully
to rfcs?  i will check the return type of the HTTP response
for you: it may not be responding with HTTP/1.1 but
may be responding with some new/silly draft HTML thing.

whoops.

----------------------------------------------------------------------

Comment By: Fred L. Drake, Jr.
Date: 2001-03-03 09:41

Message:
Logged In: YES 
user_id=3066

Sounds to me like a problem with the server; the response is invalid.  Section 6.1.1 of the HTTP/1.1 RFC states that response codes should be three digits, not three digits and then some dotted thing:

ftp://ftp.isi.edu/in-notes/rfc2616.txt

It may be appropriate to make httplib only examine the first three digits when converting to an integer, but I'm not sure that's really a good idea.

Assigned to Jeremy since he's been playing with urllib2.

----------------------------------------------------------------------

Comment By: Martin v. Löwis
Date: 2001-03-02 16:03

Message:
Logged In: YES 
user_id=21627

Assuming that the response is something like

HTTP/1.1 400.100 Something went wrong

I think that the server is misbehaving. Such a response is a
clear violation of RFC 2616 (Hypertext Transfer Protocol --
-- HTTP/1.1), section 6.1.,

Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase
CRLF

Section 6.1.1 elaborates the meaning of Status-code,
defining it as "a 3-digit integer result code". Maybe MS
misunderstood the meaning of extension-code, which is an
alternative to Status-code, not an additional piece of
information sent after a full-stop.

I propose to close this as "Won't Fix". Since the server
does not use the HTTP protocol, it does not need to be
supported in httplib. If you need that function, you'll have
to specialize httplib, e.g. by inheriting from HTTPResponse.


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=405427&group_id=5470