Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-httplib2 for openSUSE:Factory 
checked in at 2022-11-10 14:21:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-httplib2 (Old)
 and      /work/SRC/openSUSE:Factory/.python-httplib2.new.1597 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-httplib2"

Thu Nov 10 14:21:23 2022 rev:53 rq:1034614 version:0.21.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-httplib2/python-httplib2.changes  
2022-02-17 00:30:12.001436718 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-httplib2.new.1597/python-httplib2.changes    
    2022-11-10 14:21:43.162157777 +0100
@@ -1,0 +2,8 @@
+Tue Nov  8 17:10:10 UTC 2022 - Yogalakshmi Arunachalam <[email protected]>
+
+- Update to 0.21.0: 
+  * http: `Content-Encoding: deflate` must accept zlib encapsulation
+  * https://github.com/httplib2/httplib2/pull/230
+  * Begin support and CI against CPython 3.10 and 3.11.
+
+-------------------------------------------------------------------

Old:
----
  httplib2-0.20.4.tar.gz

New:
----
  httplib2-0.21.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-httplib2.spec ++++++
--- /var/tmp/diff_new_pack.CNiggV/_old  2022-11-10 14:21:45.014168260 +0100
+++ /var/tmp/diff_new_pack.CNiggV/_new  2022-11-10 14:21:45.018168283 +0100
@@ -20,7 +20,7 @@
 # Tests require network connection
 %bcond_with tests
 Name:           python-httplib2
-Version:        0.20.4
+Version:        0.21.0
 Release:        0
 Summary:        A Python HTTP client library
 License:        Apache-2.0 AND MIT AND (GPL-2.0-or-later OR MPL-1.1 OR 
LGPL-2.1-or-later)

++++++ httplib2-0.20.4.tar.gz -> httplib2-0.21.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/httplib2-0.20.4/CHANGELOG 
new/httplib2-0.21.0/CHANGELOG
--- old/httplib2-0.20.4/CHANGELOG       2022-02-03 00:32:08.000000000 +0100
+++ new/httplib2-0.21.0/CHANGELOG       2022-10-29 14:30:46.000000000 +0200
@@ -1,3 +1,10 @@
+0.21.0
+
+  http: `Content-Encoding: deflate` must accept zlib encapsulation
+  https://github.com/httplib2/httplib2/pull/230
+
+  Begin support and CI against CPython 3.10 and 3.11.
+
 0.20.4
 
   proxy: support proxy urls with ipv6 address
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/httplib2-0.20.4/MANIFEST.in 
new/httplib2-0.21.0/MANIFEST.in
--- old/httplib2-0.20.4/MANIFEST.in     2022-02-03 00:32:08.000000000 +0100
+++ new/httplib2-0.21.0/MANIFEST.in     2022-10-29 14:30:46.000000000 +0200
@@ -7,6 +7,7 @@
 include LICENSE
 include requirements*.txt
 exclude codecov.yml
+exclude .pre-commit-*.yaml
 prune ref
 global-exclude __pycache__
 global-exclude *.py[cod]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/httplib2-0.20.4/PKG-INFO new/httplib2-0.21.0/PKG-INFO
--- old/httplib2-0.20.4/PKG-INFO        2022-02-03 00:32:24.736396800 +0100
+++ new/httplib2-0.21.0/PKG-INFO        2022-10-29 14:31:23.789925800 +0200
@@ -1,12 +1,11 @@
 Metadata-Version: 2.1
 Name: httplib2
-Version: 0.20.4
+Version: 0.21.0
 Summary: A comprehensive HTTP client library.
 Home-page: https://github.com/httplib2/httplib2
 Author: Joe Gregorio
 Author-email: [email protected]
 License: MIT
-Platform: UNKNOWN
 Classifier: Development Status :: 4 - Beta
 Classifier: Environment :: Web Environment
 Classifier: Intended Audience :: Developers
@@ -22,6 +21,8 @@
 Classifier: Programming Language :: Python :: 3.7
 Classifier: Programming Language :: Python :: 3.8
 Classifier: Programming Language :: Python :: 3.9
+Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
 Classifier: Topic :: Internet :: WWW/HTTP
 Classifier: Topic :: Software Development :: Libraries
 Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
@@ -70,5 +71,3 @@
 
 **Unit Tested**
   A large and growing set of unit tests.
-
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/httplib2-0.20.4/README.md 
new/httplib2-0.21.0/README.md
--- old/httplib2-0.20.4/README.md       2022-02-03 00:32:08.000000000 +0100
+++ new/httplib2-0.21.0/README.md       2022-10-29 14:30:46.000000000 +0200
@@ -4,6 +4,8 @@
 httplib2 is a comprehensive HTTP client library, httplib2.py supports many
 features left out of other HTTP libraries.
 
+If you want to help this project by bug report or code change, [contribution 
guidelines](contributing.md) may contain useful information.
+
 ### HTTP and HTTPS
 
 HTTPS support is only available if the socket module was
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/httplib2-0.20.4/contributing.md 
new/httplib2-0.21.0/contributing.md
--- old/httplib2-0.20.4/contributing.md 1970-01-01 01:00:00.000000000 +0100
+++ new/httplib2-0.21.0/contributing.md 2022-10-29 14:30:46.000000000 +0200
@@ -0,0 +1,26 @@
+# Welcome
+
+You have come to the right place if you want to support httplib2 by doing. 
Thank you!
+
+- [Reporting security / sensitive issues](SECURITY.md)
+- [Regular issues](https://github.com/httplib2/httplib2/issues?q=) please try 
to find existing solution first, search without issue/open filters.
+- If you intend to propose code change, there is no need to open an issue 
first. Pull request is more than enough. `git diff` in message is fine too.
+- Tests use TLS certificates/keys generated by `script/generate-tls`
+
+
+## Submitting changes (pull request policy)
+
+- Run `pre-commit install` once to setup hooks that detect/fix common style 
issues and run unit tests. [pre-commit website](https://pre-commit.com/)
+- If you don't want pre-commit hooks, please run `script/test` before commit
+- Test is required, or at least coverage must not decrease
+- One commit is strongly preferred, except for very big changes
+- Feel free to append yourself into __contributors__
+- Commit message should follow the following formula:
+
+>subsystem: description of why the change is useful
+>
+>optional details
+>
+>links to related issues or websites
+
+The why part is very important. Diff already says what is changed. Explain why.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/httplib2-0.20.4/python2/httplib2/__init__.py 
new/httplib2-0.21.0/python2/httplib2/__init__.py
--- old/httplib2-0.20.4/python2/httplib2/__init__.py    2022-02-03 
00:32:08.000000000 +0100
+++ new/httplib2-0.21.0/python2/httplib2/__init__.py    2022-10-29 
14:30:46.000000000 +0200
@@ -17,9 +17,10 @@
     "Sam Ruby",
     "Louis Nyffenegger",
     "Alex Yu",
+    "Lai Han",
 ]
 __license__ = "MIT"
-__version__ = "0.20.4"
+__version__ = "0.21.0"
 
 import base64
 import calendar
@@ -467,7 +468,10 @@
             if encoding == "gzip":
                 content = 
gzip.GzipFile(fileobj=StringIO.StringIO(new_content)).read()
             if encoding == "deflate":
-                content = zlib.decompress(content, -zlib.MAX_WBITS)
+                try:
+                    content = zlib.decompress(content, zlib.MAX_WBITS)
+                except (IOError, zlib.error):
+                    content = zlib.decompress(content, -zlib.MAX_WBITS)
             response["content-length"] = str(len(content))
             # Record the historical presence of the encoding in a way the 
won't interfere.
             response["-content-encoding"] = response["content-encoding"]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/httplib2-0.20.4/python3/httplib2/__init__.py 
new/httplib2-0.21.0/python3/httplib2/__init__.py
--- old/httplib2-0.20.4/python3/httplib2/__init__.py    2022-02-03 
00:32:08.000000000 +0100
+++ new/httplib2-0.21.0/python3/httplib2/__init__.py    2022-10-29 
14:30:46.000000000 +0200
@@ -13,9 +13,10 @@
     "Louis Nyffenegger",
     "Mark Pilgrim",
     "Alex Yu",
+    "Lai Han",
 ]
 __license__ = "MIT"
-__version__ = "0.20.4"
+__version__ = "0.21.0"
 
 import base64
 import calendar
@@ -128,8 +129,14 @@
 # Both PROTOCOL_TLS and PROTOCOL_SSLv23 are equivalent and means:
 # > Selects the highest protocol version that both the client and server 
support.
 # > Despite the name, this option can select ???TLS??? protocols as well as 
???SSL???.
-# source: https://docs.python.org/3.5/library/ssl.html#ssl.PROTOCOL_TLS
-DEFAULT_TLS_VERSION = getattr(ssl, "PROTOCOL_TLS", None) or getattr(ssl, 
"PROTOCOL_SSLv23")
+# source: https://docs.python.org/3.5/library/ssl.html#ssl.PROTOCOL_SSLv23
+
+# PROTOCOL_TLS_CLIENT is python 3.10.0+. PROTOCOL_TLS is deprecated.
+# > Auto-negotiate the highest protocol version that both the client and 
server support, and configure the context client-side connections.
+# > The protocol enables CERT_REQUIRED and check_hostname by default.
+# source: https://docs.python.org/3.10/library/ssl.html#ssl.PROTOCOL_TLS
+
+DEFAULT_TLS_VERSION = getattr(ssl, "PROTOCOL_TLS_CLIENT", None) or 
getattr(ssl, "PROTOCOL_TLS", None) or getattr(ssl, "PROTOCOL_SSLv23")
 
 
 def _build_ssl_context(
@@ -183,16 +190,25 @@
     return [header for header in list(response.keys()) if header not in 
hopbyhop]
 
 
+_missing = object()
+
+
 def _errno_from_exception(e):
+    # TODO python 3.11+ cheap try: return e.errno except AttributeError: pass
+    errno = getattr(e, "errno", _missing)
+    if errno is not _missing:
+        return errno
+
     # socket.error and common wrap in .args
-    if len(e.args) > 0:
-        return e.args[0].errno if isinstance(e.args[0], socket.error) else 
e.errno
+    args = getattr(e, "args", None)
+    if args:
+        return _errno_from_exception(args[0])
 
     # pysocks.ProxyError wraps in .socket_err
     # https://github.com/httplib2/httplib2/pull/202
-    if hasattr(e, "socket_err"):
-        e_int = e.socket_err
-        return e_int.args[0].errno if isinstance(e_int.args[0], socket.error) 
else e_int.errno
+    socket_err = getattr(e, "socket_err", None)
+    if socket_err:
+        return _errno_from_exception(socket_err)
 
     return None
 
@@ -374,7 +390,10 @@
             if encoding == "gzip":
                 content = gzip.GzipFile(fileobj=io.BytesIO(new_content)).read()
             if encoding == "deflate":
-                content = zlib.decompress(content, -zlib.MAX_WBITS)
+                try:
+                    content = zlib.decompress(content, zlib.MAX_WBITS)
+                except (IOError, zlib.error):
+                    content = zlib.decompress(content, -zlib.MAX_WBITS)
             response["content-length"] = str(len(content))
             # Record the historical presence of the encoding in a way the 
won't interfere.
             response["-content-encoding"] = response["content-encoding"]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/httplib2-0.20.4/python3/httplib2.egg-info/PKG-INFO 
new/httplib2-0.21.0/python3/httplib2.egg-info/PKG-INFO
--- old/httplib2-0.20.4/python3/httplib2.egg-info/PKG-INFO      2022-02-03 
00:32:24.000000000 +0100
+++ new/httplib2-0.21.0/python3/httplib2.egg-info/PKG-INFO      2022-10-29 
14:31:23.000000000 +0200
@@ -1,12 +1,11 @@
 Metadata-Version: 2.1
 Name: httplib2
-Version: 0.20.4
+Version: 0.21.0
 Summary: A comprehensive HTTP client library.
 Home-page: https://github.com/httplib2/httplib2
 Author: Joe Gregorio
 Author-email: [email protected]
 License: MIT
-Platform: UNKNOWN
 Classifier: Development Status :: 4 - Beta
 Classifier: Environment :: Web Environment
 Classifier: Intended Audience :: Developers
@@ -22,6 +21,8 @@
 Classifier: Programming Language :: Python :: 3.7
 Classifier: Programming Language :: Python :: 3.8
 Classifier: Programming Language :: Python :: 3.9
+Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
 Classifier: Topic :: Internet :: WWW/HTTP
 Classifier: Topic :: Software Development :: Libraries
 Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
@@ -70,5 +71,3 @@
 
 **Unit Tested**
   A large and growing set of unit tests.
-
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/httplib2-0.20.4/python3/httplib2.egg-info/SOURCES.txt 
new/httplib2-0.21.0/python3/httplib2.egg-info/SOURCES.txt
--- old/httplib2-0.20.4/python3/httplib2.egg-info/SOURCES.txt   2022-02-03 
00:32:24.000000000 +0100
+++ new/httplib2-0.21.0/python3/httplib2.egg-info/SOURCES.txt   2022-10-29 
14:31:23.000000000 +0200
@@ -3,6 +3,7 @@
 MANIFEST.in
 README.md
 SECURITY.md
+contributing.md
 pyproject.toml
 requirements-test.txt
 requirements.txt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/httplib2-0.20.4/setup.py new/httplib2-0.21.0/setup.py
--- old/httplib2-0.20.4/setup.py        2022-02-03 00:32:08.000000000 +0100
+++ new/httplib2-0.21.0/setup.py        2022-10-29 14:30:46.000000000 +0200
@@ -4,7 +4,7 @@
 import sys
 
 pkgdir = {"": "python%s" % sys.version_info[0]}
-VERSION = "0.20.4"
+VERSION = "0.21.0"
 
 
 # `python setup.py test` uses existing Python environment, no virtualenv, no 
pip.
@@ -106,6 +106,8 @@
         "Programming Language :: Python :: 3.7",
         "Programming Language :: Python :: 3.8",
         "Programming Language :: Python :: 3.9",
+        "Programming Language :: Python :: 3.10",
+        "Programming Language :: Python :: 3.11",
         "Topic :: Internet :: WWW/HTTP",
         "Topic :: Software Development :: Libraries",
     ],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/httplib2-0.20.4/tests/__init__.py 
new/httplib2-0.21.0/tests/__init__.py
--- old/httplib2-0.20.4/tests/__init__.py       2022-02-03 00:32:08.000000000 
+0100
+++ new/httplib2-0.21.0/tests/__init__.py       2022-10-29 14:30:46.000000000 
+0200
@@ -755,6 +755,15 @@
     return zlib.decompress(bs, -zlib.MAX_WBITS)
 
 
+def zlib_compress(bs):
+    do = zlib.compressobj(9, zlib.DEFLATED, zlib.MAX_WBITS)
+    return do.compress(bs) + do.flush()
+
+
+def zlib_decompress(bs):
+    return zlib.decompress(bs, zlib.MAX_WBITS)
+
+
 def ssl_context(protocol=None):
     """Workaround for old SSLContext() required protocol argument."""
     if sys.version_info < (3, 5, 3):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/httplib2-0.20.4/tests/test_encoding.py 
new/httplib2-0.21.0/tests/test_encoding.py
--- old/httplib2-0.20.4/tests/test_encoding.py  2022-02-03 00:32:08.000000000 
+0100
+++ new/httplib2-0.21.0/tests/test_encoding.py  2022-10-29 14:30:46.000000000 
+0200
@@ -95,3 +95,18 @@
         response, content = http.request(uri, "GET")
         assert response.status == 500
         assert response.reason.startswith("Content purported")
+
+
+def test_zlib_get():
+    # Test that we support zlib compression
+    http = httplib2.Http()
+    response = tests.http_response_bytes(
+        headers={"content-encoding": "deflate"},
+        body=tests.zlib_compress(b"properly compressed"),
+    )
+    with tests.server_const_bytes(response) as uri:
+        response, content = http.request(uri, "GET")
+        assert response.status == 200
+        assert "content-encoding" not in response
+        assert int(response["content-length"]) == len(b"properly compressed")
+        assert content == b"properly compressed"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/httplib2-0.20.4/tests/test_https.py 
new/httplib2-0.21.0/tests/test_https.py
--- old/httplib2-0.20.4/tests/test_https.py     2022-02-03 00:32:08.000000000 
+0100
+++ new/httplib2-0.21.0/tests/test_https.py     2022-10-29 14:30:46.000000000 
+0200
@@ -1,5 +1,7 @@
+import platform
 import socket
 import ssl
+import sys
 
 import pytest
 from six.moves import urllib
@@ -73,17 +75,25 @@
             pass
 
 
-ssl_context_accept_version = hasattr(tests.ssl_context(), "maximum_version") 
and hasattr(
-    tests.ssl_context(), "minimum_version"
+ssl_context_accept_version = (
+    hasattr(tests.ssl_context(), "maximum_version")
+    and hasattr(tests.ssl_context(), "minimum_version")
+    and not (platform.python_implementation().lower() == "pypy" and 
sys.version_info < (3,))
+)
+tls_minmax_versions = (
+    (None, "TLSv1_2", ssl.TLSVersion.TLSv1_2)
+    # TODO remove pypy2 workaround `and hasattr` clause
+    if ssl_context_accept_version and hasattr(ssl, "TLSVersion") else (None,)
 )
 
 
 @pytest.mark.skipif(not ssl_context_accept_version, reason="ssl doesn't 
support TLS min/max")
 @pytest.mark.parametrize("attr", ("maximum_version", "minimum_version"))
[email protected]("version", (None, "TLSv1_2", ssl.TLSVersion.TLSv1_2) 
if ssl_context_accept_version else (None,))
[email protected]("version", tls_minmax_versions)
 def test_set_tls_version(attr, version):
+    ctx = tests.ssl_context()
     # We expect failure on Python < 3.7 or OpenSSL < 1.1
-    expect_success = hasattr(ssl.SSLContext(), attr)
+    expect_success = hasattr(ctx, attr)
     kwargs = {"tls_" + attr: version}
     http = httplib2.Http(**kwargs)
     try:
@@ -94,10 +104,7 @@
         assert expect_success
 
 
[email protected](
-    not hasattr(tests.ssl_context(), "maximum_version"),
-    reason="ssl doesn't support TLS min/max",
-)
[email protected](not ssl_context_accept_version, reason="ssl doesn't 
support TLS min/max")
 def test_max_tls_version():
     http = httplib2.Http(ca_certs=tests.CA_CERTS, 
tls_maximum_version="TLSv1_2")
     with tests.server_const_http(tls=True) as uri:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/httplib2-0.20.4/tests/test_other.py 
new/httplib2-0.21.0/tests/test_other.py
--- old/httplib2-0.20.4/tests/test_other.py     2022-02-03 00:32:08.000000000 
+0100
+++ new/httplib2-0.21.0/tests/test_other.py     2022-10-29 14:30:46.000000000 
+0200
@@ -188,7 +188,7 @@
     end2end = httplib2._get_end2end_headers(response)
     assert len(end2end) == 0
 
-    # Degenerate case of connection referrring to a header not passed in
+    # Degenerate case of connection referring to a header not passed in
     response = {"connection": "content-type"}
     end2end = httplib2._get_end2end_headers(response)
     assert len(end2end) == 0

Reply via email to