]> granicus.if.org Git - python/commitdiff
#17460: Remove the strict argument of HTTPConnection and removing the
authorSenthil Kumaran <senthil@uthcode.com>
Mon, 18 Mar 2013 21:11:41 +0000 (14:11 -0700)
committerSenthil Kumaran <senthil@uthcode.com>
Mon, 18 Mar 2013 21:11:41 +0000 (14:11 -0700)
DeprecationWarning being issued from 3.2 onwards.

Doc/library/http.client.rst
Lib/http/client.py
Misc/NEWS

index 2d93aa47c3868b2b34d1f7ccca38d5f254d982e0..c4c76172b4c4f21b42cfb1c7b685592295c5a538 100644 (file)
@@ -27,7 +27,7 @@ HTTPS protocols.  It is normally not used directly --- the module
 The module provides the following classes:
 
 
-.. class:: HTTPConnection(host, port=None[, strict][, timeout], \
+.. class:: HTTPConnection(host, port=None[, timeout], \
                           source_address=None)
 
    An :class:`HTTPConnection` instance represents one transaction with an HTTP
@@ -51,13 +51,9 @@ The module provides the following classes:
    .. versionchanged:: 3.2
       *source_address* was added.
 
-   .. versionchanged:: 3.2
-      The *strict* parameter is deprecated.  HTTP 0.9-style "Simple Responses"
-      are not supported anymore.
-
 
 .. class:: HTTPSConnection(host, port=None, key_file=None, \
-                           cert_file=None[, strict][, timeout], \
+                           cert_file=None[, timeout], \
                            source_address=None, *, context=None, \
                            check_hostname=None)
 
@@ -89,20 +85,12 @@ The module provides the following classes:
       This class now supports HTTPS virtual hosts if possible (that is,
       if :data:`ssl.HAS_SNI` is true).
 
-   .. versionchanged:: 3.2
-      The *strict* parameter is deprecated.  HTTP 0.9-style "Simple Responses"
-      are not supported anymore.
-
 
-.. class:: HTTPResponse(sock, debuglevel=0[, strict], method=None, url=None)
+.. class:: HTTPResponse(sock, debuglevel=0, method=None, url=None)
 
    Class whose instances are returned upon successful connection.  Not
    instantiated directly by user.
 
-   .. versionchanged:: 3.2
-      The *strict* parameter is deprecated.  HTTP 0.9-style "Simple Responses"
-      are not supported anymore.
-
 
 The following exceptions are raised as appropriate:
 
index ba7d6fc38cf9d7ea7e37c7a26125f3597c0f68ad..08311d7bb829cf1652f245c18eb0d79703825002 100644 (file)
@@ -267,8 +267,6 @@ def parse_headers(fp, _class=HTTPMessage):
     return email.parser.Parser(_class=_class).parsestr(hstring)
 
 
-_strict_sentinel = object()
-
 class HTTPResponse(io.RawIOBase):
 
     # See RFC 2616 sec 19.6 and RFC 1945 sec 6 for details.
@@ -278,7 +276,7 @@ class HTTPResponse(io.RawIOBase):
     # text following RFC 2047.  The basic status line parsing only
     # accepts iso-8859-1.
 
-    def __init__(self, sock, debuglevel=0, strict=_strict_sentinel, method=None, url=None):
+    def __init__(self, sock, debuglevel=0, method=None, url=None):
         # If the response includes a content-length header, we need to
         # make sure that the client doesn't read more than the
         # specified number of bytes.  If it does, it will block until
@@ -288,10 +286,6 @@ class HTTPResponse(io.RawIOBase):
         # clients unless they know what they are doing.
         self.fp = sock.makefile("rb")
         self.debuglevel = debuglevel
-        if strict is not _strict_sentinel:
-            warnings.warn("the 'strict' argument isn't supported anymore; "
-                "http.client now always assumes HTTP/1.x compliant servers.",
-                DeprecationWarning, 2)
         self._method = method
 
         # The HTTPResponse object is returned via urllib.  The clients
@@ -737,12 +731,8 @@ class HTTPConnection:
     # as a reasonable estimate of the maximum MSS.
     mss = 16384
 
-    def __init__(self, host, port=None, strict=_strict_sentinel,
-                 timeout=socket._GLOBAL_DEFAULT_TIMEOUT, source_address=None):
-        if strict is not _strict_sentinel:
-            warnings.warn("the 'strict' argument isn't supported anymore; "
-                "http.client now always assumes HTTP/1.x compliant servers.",
-                DeprecationWarning, 2)
+    def __init__(self, host, port=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
+                 source_address=None):
         self.timeout = timeout
         self.source_address = source_address
         self.sock = None
@@ -1177,9 +1167,10 @@ else:
         # XXX Should key_file and cert_file be deprecated in favour of context?
 
         def __init__(self, host, port=None, key_file=None, cert_file=None,
-                     strict=_strict_sentinel, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
-                     source_address=None, *, context=None, check_hostname=None):
-            super(HTTPSConnection, self).__init__(host, port, strict, timeout,
+                     timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
+                     source_address=None, *, context=None,
+                     check_hostname=None):
+            super(HTTPSConnection, self).__init__(host, port, timeout,
                                                   source_address)
             self.key_file = key_file
             self.cert_file = cert_file
index ad321f593f3ea6a3b7c9c7c2c33435ff6b9bb11f..1f3c68a6467b12a055bbbdcb2195144146253e71 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -287,7 +287,10 @@ Core and Builtins
 Library
 -------
 
-Issue #16880: Do not assume _imp.load_dynamic() is defined in the imp module.
+- Issue #17460: Remove the strict argument of HTTPConnection and removing the
+  DeprecationWarning being issued from 3.2 onwards.
+
+- Issue #16880: Do not assume _imp.load_dynamic() is defined in the imp module.
 
 - Issue #16389: Fixed a performance regression relative to Python 3.1 in the
   caching of compiled regular expressions.