[Python-Dev] r87399 - in python/branches/py3k: Doc/library/http.client.rst Doc/library/urllib.request.rst Lib/http/client.py Lib/test/test_httplib.py Lib/test/test_urllib2.py Lib/urllib/request.py Misc/NEWS

Antoine Pitrou solipsis at pitrou.net
Sun Dec 19 14:23:02 CET 2010


Hello Senthil,

> +                raise TypeError("data should be byte-like object\

Should be "bytes-like".

> +                    request.add_unredirected_header(
> +                            'Content-length', '%d' % len(mv) * mv.itemsize)

There is an operator precedence problem here:

>>> "%d" % 4 * 5
'44444'


> +        """
> +        file_obj = io.StringIO()
> +        file_obj.write("Something\nSomething\nSomething\n")
> +

Why is this whole thing commented out? If it wasn't, you would have seen
the test failing.

Thanks

Antoine.




More information about the Python-Dev mailing list