summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/http/client.py9
-rw-r--r--Lib/string.py5
2 files changed, 8 insertions, 6 deletions
diff --git a/Lib/http/client.py b/Lib/http/client.py
index 4a078d3..a4ec8e5 100644
--- a/Lib/http/client.py
+++ b/Lib/http/client.py
@@ -812,7 +812,7 @@ class HTTPConnection:
# For HTTP/1.0, the server will assume "not chunked"
pass
- def putheader(self, header, value):
+ def putheader(self, header, *values):
"""Send a request header line to the server.
For example: h.putheader('Accept', 'text/html')
@@ -822,8 +822,11 @@ class HTTPConnection:
if hasattr(header, 'encode'):
header = header.encode('ascii')
- if hasattr(value, 'encode'):
- value = value.encode('ascii')
+ values = list(values)
+ for i, one_value in enumerate(values):
+ if hasattr(one_value, 'encode'):
+ values[i] = one_value.encode('ascii')
+ value = b'\r\n\t'.join(values)
header = header + b': ' + value
self._output(header)
diff --git a/Lib/string.py b/Lib/string.py
index 7f67abd..2044155 100644
--- a/Lib/string.py
+++ b/Lib/string.py
@@ -189,9 +189,8 @@ class Template(metaclass=_TemplateMetaclass):
# the Formatter class
# see PEP 3101 for details and purpose of this class
-# The hard parts are reused from the C implementation. They're
-# exposed here via the sys module. sys was chosen because it's always
-# available and doesn't have to be dynamically loaded.
+# The hard parts are reused from the C implementation. They're exposed as "_"
+# prefixed methods of str and unicode.
# The overall parser is implemented in str._formatter_parser.
# The field name parser is implemented in str._formatter_field_name_split