[issue12327] in HTTPConnection the are len(body) and TypeError catch exception to detect if body is file like object, this hack do work with StringIO object

2015-04-13 Thread Martin Panter
Martin Panter added the comment: For the record, it looks like there were a few distinct but related problems here: * Passing any StringIO object as the body is not supported (see https://docs.python.org/2/library/httplib.html#httplib.HTTPConnection.request), because no StringIO class

[issue12327] in HTTPConnection the are len(body) and TypeError catch exception to detect if body is file like object, this hack do work with StringIO object

2015-04-12 Thread R. David Murray
R. David Murray added the comment: Length computation is being dealt with in issue 23350. -- resolution: - duplicate stage: needs patch - resolved status: open - closed superseder: - Content-length is incorrect when request body is a list or tuple

[issue12327] in HTTPConnection the are len(body) and TypeError catch exception to detect if body is file like object, this hack do work with StringIO object

2014-02-03 Thread Mark Lawrence
Changes by Mark Lawrence breamore...@yahoo.co.uk: -- nosy: -BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12327 ___ ___

[issue12327] in HTTPConnection the are len(body) and TypeError catch exception to detect if body is file like object, this hack do work with StringIO object

2013-04-03 Thread Mark Lawrence
Mark Lawrence added the comment: @harobed if you still have a problem please provide more data as requested in msg138692. -- nosy: +BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12327

[issue12327] in HTTPConnection the are len(body) and TypeError catch exception to detect if body is file like object, this hack do work with StringIO object

2011-06-20 Thread Senthil Kumaran
Senthil Kumaran sent...@uthcode.com added the comment: Hello Stephane, I use HTTPConnection to simulate Apple Finder WebDAV client. When this WebDAV client do PUT request, it transmit data in chunked encoding mode and not set Content-Length HTTP field. Do you understand my context ? Is

[issue12327] in HTTPConnection the are len(body) and TypeError catch exception to detect if body is file like object, this hack do work with StringIO object

2011-06-15 Thread harobed
harobed steph...@harobed.org added the comment: But if the len information is available, why not return it? I use HTTPConnection to simulate Apple Finder WebDAV client. When this WebDAV client do PUT request, it transmit data in chunked encoding mode and not set Content-Length HTTP field. Do

[issue12327] in HTTPConnection the are len(body) and TypeError catch exception to detect if body is file like object, this hack do work with StringIO object

2011-06-15 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: The code you are suggesting patching is trying its best to return a length. If that code needs to be fixed to not throw an error when confronted with a StringIO, then it should do its best to return a length. Your original message on

[issue12327] in HTTPConnection the are len(body) and TypeError catch exception to detect if body is file like object, this hack do work with StringIO object

2011-06-13 Thread harobed
New submission from harobed steph...@harobed.org: Hi, in httplib.HTTPConnection._send_request (Python 2.6) in httplib.HTTPConnection._set_content_length (Python 2.7) and http.client.HTTPConnection._set_content_length (Python 3.3) there are something like that : try: thelen

[issue12327] in HTTPConnection the are len(body) and TypeError catch exception to detect if body is file like object, this hack do work with StringIO object

2011-06-13 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: fileno and stat won't work on a StringIO object. So StringIO would need to be special cased to call getvalue. -- nosy: +orsenthil, r.david.murray ___ Python tracker rep...@bugs.python.org

[issue12327] in HTTPConnection the are len(body) and TypeError catch exception to detect if body is file like object, this hack do work with StringIO object

2011-06-13 Thread harobed
harobed steph...@harobed.org added the comment: fileno and stat won't work on a StringIO object. So StringIO would need to be special cased to call getvalue. Yes, but it isn't important in chunk transfer encoding. -- ___ Python tracker

[issue12327] in HTTPConnection the are len(body) and TypeError catch exception to detect if body is file like object, this hack do work with StringIO object

2011-06-13 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: But if the len information is available, why not return it? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12327 ___

[issue12327] in HTTPConnection the are len(body) and TypeError catch exception to detect if body is file like object, this hack do work with StringIO object

2011-06-13 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- versions: +Python 3.2 -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12327 ___ ___