[issue23740] http.client request and send method have some datatype issues

2021-03-05 Thread Alex Willmer
Alex Willmer added the comment: http_dump.py now covers CPython 3.6-3.10 (via Tox), and HTTPSConnection https://github.com/moreati/bpo-23740 -- ___ Python tracker ___

[issue23740] http.client request and send method have some datatype issues

2021-03-02 Thread Alex Willmer
Alex Willmer added the comment: First stab at characterising http.client.HTTPConnnection.send(). https://github.com/moreati/bpo-23740 This uses a webserver that returns request details, in the body of the response. Raw (TCP level) content is included. It shares a similar purpose to HTTP

[issue23740] http.client request and send method have some datatype issues

2021-03-02 Thread Alex Willmer
Alex Willmer added the comment: A data point found while I researched this MyPy typeshed [1] currently declares _DataType = Union[bytes, IO[Any], Iterable[bytes], str] class HTTPConnection: def send(self, data: _DataType) -> None: ... [1]

[issue23740] http.client request and send method have some datatype issues

2016-09-29 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- nosy: +Mariatta ___ Python tracker ___ ___

[issue23740] http.client request and send method have some datatype issues

2016-08-07 Thread Martin Panter
Martin Panter added the comment: I’ve decided I would prefer deprecating the Latin-1 encoding, rather than adding more encoding support for iterables and text files. If not deprecating it altogether, at least prefer just ASCII encoding (like Python 2). The urlopen() function already rejects

[issue23740] http.client request and send method have some datatype issues

2016-06-16 Thread Martin Panter
Changes by Martin Panter : -- dependencies: +bytes-like objects with socket.sendall(), SSL, and http.client ___ Python tracker ___

[issue23740] http.client request and send method have some datatype issues

2015-04-18 Thread Akshit Khurana
Changes by Akshit Khurana axitkhur...@gmail.com: -- nosy: +axitkhurana ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23740 ___ ___

[issue23740] http.client request and send method have some datatype issues

2015-04-15 Thread Martin Panter
Martin Panter added the comment: The priority of file-like objects versus bytes-like and iterable objects should be well defined. See Issue 5038: mmap objects seem to satisfy all three interfaces, but the result may be different depending on the file position. --

[issue23740] http.client request and send method have some datatype issues

2015-03-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Note that for file-like objects we have also the same issue as issue22468. Content-Length is not determined correctly for GzipFile and like. -- ___ Python tracker rep...@bugs.python.org

[issue23740] http.client request and send method have some datatype issues

2015-03-22 Thread Demian Brecht
Demian Brecht added the comment: FWIW, I've done some additional work to request/send in issue #12319 where I've added support for chunked request encoding. @David if an iterable is passed in, it must be an iterable of bytes-like objects This specific issue is addressed in the patch in

[issue23740] http.client request and send method have some datatype issues

2015-03-22 Thread R. David Murray
New submission from R. David Murray: While committing the patch for issue 23539 I decided to rewrite the 'request' docs for clarity. I doing so I found that http.client isn't as consistent as it could be about how it handles bytes and strings. Two points specifically: it will only take the

[issue23740] http.client request and send method have some datatype issues

2015-03-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue23350 and issue23360. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23740 ___

[issue23740] http.client request and send method have some datatype issues

2015-03-22 Thread Martin Panter
Martin Panter added the comment: As well as encoding iterables of str(), text files could also be handled more consistently by checking the read() return type. That would eliminate the complication of checking for a b mode. -- ___ Python tracker

[issue23740] http.client request and send method have some datatype issues

2015-03-22 Thread Martin Panter
Martin Panter added the comment: Summary of the main supported types as I see them, whether documented, undocumented, or only working by accident: * None * Bytes-like sequences, e.g. bytes(), bytearray. I believe Content-Length is actually automatically set for all these types. * Arbitrary

[issue23740] http.client request and send method have some datatype issues

2015-03-22 Thread R. David Murray
R. David Murray added the comment: Yeah, if we're going to check the type for iterables to convert strings, we might as well check the type for read() as well. The bit about the len not being set except for str and bytes was me mis-remembering what I read in the code. (The isinstance check