New submission from Cliff Wells <[email protected]>:
httplib.py ~Line 924
def putheader(self, header, *values):
str = '%s: %s' % (header, '\r\n\t'.join(values))
self._output(str)
should be changed to something like:
def putheader(self, header, *values):
...
s = '%s: %s' % (header, '\r\n\t'.join([str(v) for v in values]))
self._output(s)
The current version shadows str builtin with a local variable. join method
assumes strings so they should probably be explicitly cast (at least one 3rd
party library appears to pass Content-length as an integer, causing this to
fail. Of course, this can't be done unless the str builtin is no longer
shadowed.
----------
components: Library (Lib)
messages: 117852
nosy: cwells
priority: normal
severity: normal
status: open
title: httplib shadows builtin, assumes strings
versions: Python 2.7
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue10012>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com