diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/email/charset.py | 4 | ||||
-rw-r--r-- | Lib/http/client.py | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/Lib/email/charset.py b/Lib/email/charset.py index a44b711..898beed 100644 --- a/Lib/email/charset.py +++ b/Lib/email/charset.py @@ -294,7 +294,7 @@ class Charset: """Header-encode a string by converting it first to bytes. This is similar to `header_encode()` except that the string is fit - into maximum line lengths as given by the arguments. + into maximum line lengths as given by the argument. :param string: A unicode string for the header. It must be possible to encode this string to bytes using the character set's @@ -305,8 +305,6 @@ class Charset: and should never be exhausted. The maximum line lengths should not count the RFC 2047 chrome. These line lengths are only a hint; the splitter does the best it can. - :param firstmaxlen: The maximum line length of the first line. If - None (the default), then `maxlen` is used for the first line. :return: Lines of encoded strings, each with RFC 2047 chrome. """ # See which encoding we should use. diff --git a/Lib/http/client.py b/Lib/http/client.py index 296dafb..3c70fe1 100644 --- a/Lib/http/client.py +++ b/Lib/http/client.py @@ -663,6 +663,7 @@ class HTTPConnection: self._method = None self._tunnel_host = None self._tunnel_port = None + self._tunnel_headers = {} self._set_hostport(host, port) if strict is not None: @@ -698,13 +699,14 @@ class HTTPConnection: def _tunnel(self): self._set_hostport(self._tunnel_host, self._tunnel_port) - connect_str = "CONNECT %s:%d HTTP/1.0\r\n" %(self.host, self.port) + connect_str = "CONNECT %s:%d HTTP/1.0\r\n" % (self.host, self.port) connect_bytes = connect_str.encode("ascii") self.send(connect_bytes) - for header, value in self._tunnel_headers.iteritems(): + for header, value in self._tunnel_headers.items(): header_str = "%s: %s\r\n" % (header, value) header_bytes = header_str.encode("ascii") self.send(header_bytes) + self.send(b'\r\n') response = self.response_class(self.sock, strict = self.strict, method = self._method) |