Hello community,

here is the log from the commit of package python-pycurl for openSUSE:Factory 
checked in at 2019-07-30 13:05:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pycurl (Old)
 and      /work/SRC/openSUSE:Factory/.python-pycurl.new.4126 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-pycurl"

Tue Jul 30 13:05:33 2019 rev:30 rq:717837 version:7.43.0.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pycurl/python-pycurl.changes      
2019-04-10 23:10:59.771960287 +0200
+++ /work/SRC/openSUSE:Factory/.python-pycurl.new.4126/python-pycurl.changes    
2019-07-30 13:05:37.918384122 +0200
@@ -1,0 +2,10 @@
+Tue Jul 23 10:20:14 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Update to 7.43.0.3:
+  * This release primarily fixes an OpenSSL-related installation issue, and
+    repairs the ability to use PycURL with newer libcurls compiled without
+    FTP support.
+- Rebase patch:
+  * python-pycurl-7.43.0-tls-backend.patch
+
+-------------------------------------------------------------------

Old:
----
  pycurl-7.43.0.2.tar.gz

New:
----
  pycurl-7.43.0.3.tar.gz

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

Other differences:
------------------
++++++ python-pycurl.spec ++++++
--- /var/tmp/diff_new_pack.6idyEJ/_old  2019-07-30 13:05:38.334384013 +0200
+++ /var/tmp/diff_new_pack.6idyEJ/_new  2019-07-30 13:05:38.338384011 +0200
@@ -18,7 +18,6 @@
 
 %define oldpython python
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
-
 %global flavor @BUILD_FLAVOR@%{nil}
 %if "%{flavor}" == "test"
 %define psuffix -test
@@ -28,7 +27,7 @@
 %bcond_with test
 %endif
 Name:           python-pycurl%{psuffix}
-Version:        7.43.0.2
+Version:        7.43.0.3
 Release:        0
 Summary:        PycURL -- cURL library module
 License:        LGPL-2.1-or-later AND MIT
@@ -45,9 +44,10 @@
 BuildRequires:  %{python_module devel}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
-BuildRequires:  libcurl-devel >= 7.19.0
-BuildRequires:  openssl-devel
+BuildRequires:  pkgconfig
 BuildRequires:  python-rpm-macros
+BuildRequires:  pkgconfig(libcurl) >= 7.19.0
+BuildRequires:  pkgconfig(openssl)
 %if %{with test}
 BuildRequires:  %{python_module bottle}
 BuildRequires:  %{python_module flaky}
@@ -81,7 +81,7 @@
 %build
 export CFLAGS="%{optflags} -fno-strict-aliasing"
 export PYCURL_SSL_LIBRARY=openssl
-%python_build --with-ssl
+%python_build --with-openssl
 
 %install
 export PYCURL_SSL_LIBRARY=openssl

++++++ pycurl-7.43.0.2.tar.gz -> pycurl-7.43.0.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycurl-7.43.0.2/AUTHORS new/pycurl-7.43.0.3/AUTHORS
--- old/pycurl-7.43.0.2/AUTHORS 2018-06-02 06:59:02.000000000 +0200
+++ new/pycurl-7.43.0.3/AUTHORS 2019-06-17 07:49:30.000000000 +0200
@@ -1,6 +1,6 @@
 Copyright (C) 2001-2008 by Kjetil Jacobsen <kjetilja at gmail.com>
 Copyright (C) 2001-2008 by Markus F.X.J. Oberhumer <markus at oberhumer.com>
-Copyright (C) 2013-2018 by Oleg Pudeyev <oleg at bsdpower.com>
+Copyright (C) 2013-2019 by Oleg Pudeyev <oleg at bsdpower.com>
 
 Please see README, COPYING-LGPL and COPYING-MIT for license information.
 
@@ -22,6 +22,7 @@
 Daniel Pena Arteaga <dpena at ph.tum.de>
 Daniel Stenberg <daniel at haxx.se>
 decitre <decitre at gmail.com>
+Dmitriy Taychenachev <dmitriy.taychenachev at skypicker.com>
 Dmitry Ketov <dketov at gmail.com>
 Domenico Andreoli <cavok at libero.it>
 Dominique <curl-and-python at d242.net>
@@ -37,12 +38,14 @@
 Jakub Wilk <jwilk at jwilk.net>
 Jan Kryl <jan.kryl at nexenta.com>
 Jayne <corvine at gmail.com>
+James Deucker <bitwisecook at users.noreply.github.com>
 JiCiT <jason at infinitebubble.com>
 Jim Patterson
 Jozef Melicher <jozef.melicher at eset.sk>
 K.S.Sreeram <sreeram at tachyontech.net>
 Kamil Dudka <kdudka at redhat.com>
 Kevin Ko <kevin.s.ko at gmail.com>
+Khavish Anshudass Bhundoo <khavishbhundoo at users.noreply.github.com>
 kxrd <onyeabor at riseup.net>
 Lipin Dmitriy <blackwithwhite666 at gmail.com>
 Léo El Amri <leo at superlel.me>
@@ -53,6 +56,7 @@
 Markus <nepenthesdev at gmail.com>
 Martin Muenstermann <mamuema at sourceforge.net>
 Matt King <matt at gnik.com>
+Nelson Chen <crazysim at gmail.com>
 Nick Pilon <npilon at oreilly.com>
 Oren <orenyomtov at users.noreply.github.com>
 Orion Poplawski <orion at cora.nwra.com>
@@ -66,6 +70,7 @@
 Tal Einat <tal.einat at socialcodeinc.com>
 Thomas Hunger <teh at camvine.org>
 Tino Lange <Tino.Lange at gmx.de>
+toddrme2178 <toddrme2178 at gmail.com>
 Tom Pierce <tom.pierce0 at gmail.com>
 Victor Lascurain <bittor at eleka.net>
 Vitaly Murashev <vitaly.murashev at gmail.com>
@@ -78,3 +83,4 @@
 Yuri Ushakov <yuri.ushakov at gmail.com>
 Yves Bastide <yves at botify.com>
 Zdenek Pavlas <zpavlas at redhat.com>
+ziggy <ziggy at elephant-bird.net>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycurl-7.43.0.2/COPYING-MIT 
new/pycurl-7.43.0.3/COPYING-MIT
--- old/pycurl-7.43.0.2/COPYING-MIT     2018-06-02 06:59:02.000000000 +0200
+++ new/pycurl-7.43.0.3/COPYING-MIT     2019-06-17 07:49:37.000000000 +0200
@@ -2,7 +2,7 @@
 
 Copyright (C) 2001-2008 by Kjetil Jacobsen <kjetilja at gmail.com>
 Copyright (C) 2001-2008 by Markus F.X.J. Oberhumer <markus at oberhumer.com>
-Copyright (C) 2013-2018 by Oleg Pudeyev <oleg at bsdpower.com>
+Copyright (C) 2013-2019 by Oleg Pudeyev <oleg at bsdpower.com>
 
 All rights reserved.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycurl-7.43.0.2/ChangeLog 
new/pycurl-7.43.0.3/ChangeLog
--- old/pycurl-7.43.0.2/ChangeLog       2018-06-02 06:59:02.000000000 +0200
+++ new/pycurl-7.43.0.3/ChangeLog       2019-06-17 07:51:23.000000000 +0200
@@ -1,3 +1,23 @@
+Version 7.43.0.3 [requires libcurl-7.19.0 or better] - 2019-06-17
+-----------------------------------------------------------------
+
+        * Fixed use with libcurl 7.65+ when FTP support is disabled.
+
+        * Added support for mbedTLS (patch by Josef Schlehofer).
+
+        * Fixed string processing on Python 3 (patch by Dmitriy Taychenachev).
+
+        * Added CURLOPT_TCP_FASTOPEN and CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE
+          (patch by Khavish Anshudass Bhundoo).
+
+        * Repaired inability to install PycURL when libcurl is using an SSL
+          backend other than the ones PycURL explicitly recognizes and
+          handles (OpenSSL, LibreSSL, BoringSSL, GnuTLS, NSS).
+          The requirement for setup.py to detect an SSL backend if libcurl
+          is configured to use SSL, added in 7.43.0.2, has been changed
+          to a warning to allow this.
+
+
 Version 7.43.0.2 [requires libcurl-7.19.0 or better] - 2018-06-02
 -----------------------------------------------------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycurl-7.43.0.2/INSTALL.rst 
new/pycurl-7.43.0.3/INSTALL.rst
--- old/pycurl-7.43.0.2/INSTALL.rst     2018-05-18 21:53:25.000000000 +0200
+++ new/pycurl-7.43.0.3/INSTALL.rst     2019-06-17 07:14:58.000000000 +0200
@@ -53,7 +53,7 @@
 
 To fix this, you need to tell ``setup.py`` what SSL backend is used::
 
-    python setup.py --with-[openssl|gnutls|nss] install
+    python setup.py --with-[openssl|gnutls|nss|mbedtls] install
 
 Note: as of PycURL 7.21.5, setup.py accepts ``--with-openssl`` option to
 indicate that libcurl is built against OpenSSL. ``--with-ssl`` is an alias
@@ -85,7 +85,7 @@
 The same applies to the SSL backend, if you need to specify it (see the SSL
 note above)::
 
-    export PYCURL_SSL_LIBRARY=[openssl|gnutls|nss]
+    export PYCURL_SSL_LIBRARY=[openssl|gnutls|nss|mbedtls]
     easy_install pycurl
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycurl-7.43.0.2/PKG-INFO new/pycurl-7.43.0.3/PKG-INFO
--- old/pycurl-7.43.0.2/PKG-INFO        2018-06-02 06:59:34.000000000 +0200
+++ new/pycurl-7.43.0.3/PKG-INFO        2019-06-17 07:56:09.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: pycurl
-Version: 7.43.0.2
+Version: 7.43.0.3
 Summary: PycURL -- A Python Interface To The cURL library
 Home-page: http://pycurl.io/
 Author: Oleg Pudeyev
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycurl-7.43.0.2/README.rst 
new/pycurl-7.43.0.3/README.rst
--- old/pycurl-7.43.0.2/README.rst      2018-06-02 06:59:02.000000000 +0200
+++ new/pycurl-7.43.0.3/README.rst      2019-06-17 07:49:52.000000000 +0200
@@ -174,7 +174,7 @@
 
     Copyright (C) 2001-2008 by Kjetil Jacobsen <kjetilja at gmail.com>
     Copyright (C) 2001-2008 by Markus F.X.J. Oberhumer <markus at 
oberhumer.com>
-    Copyright (C) 2013-2018 by Oleg Pudeyev <oleg at bsdpower.com>
+    Copyright (C) 2013-2019 by Oleg Pudeyev <oleg at bsdpower.com>
 
     All rights reserved.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycurl-7.43.0.2/RELEASE-NOTES.rst 
new/pycurl-7.43.0.3/RELEASE-NOTES.rst
--- old/pycurl-7.43.0.2/RELEASE-NOTES.rst       2018-06-02 06:59:02.000000000 
+0200
+++ new/pycurl-7.43.0.3/RELEASE-NOTES.rst       2019-06-17 07:51:27.000000000 
+0200
@@ -1,6 +1,14 @@
 Release Notes
 =============
 
+PycURL 7.43.0.3 - 2019-06-17
+----------------------------
+
+This release primarily fixes an OpenSSL-related installation issue, and
+repairs the ability to use PycURL with newer libcurls compiled without FTP
+support. Also, mbedTLS support has been contributed by Josef Schlehofer.
+
+
 PycURL 7.43.0.2 - 2018-06-02
 ----------------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycurl-7.43.0.2/doc/conf.py 
new/pycurl-7.43.0.3/doc/conf.py
--- old/pycurl-7.43.0.2/doc/conf.py     2018-06-02 06:59:02.000000000 +0200
+++ new/pycurl-7.43.0.3/doc/conf.py     2019-06-17 07:51:55.000000000 +0200
@@ -47,16 +47,16 @@
 
 # General information about the project.
 project = u'PycURL'
-copyright = u'2001-2018 Kjetil Jacobsen, Markus F.X.J. Oberhumer, Oleg Pudeyev'
+copyright = u'2001-2019 Kjetil Jacobsen, Markus F.X.J. Oberhumer, Oleg Pudeyev'
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
 # built documents.
 #
 # The short X.Y version.
-version = '7.43.0.2'
+version = '7.43.0.3'
 # The full version, including alpha/beta/rc tags.
-release = '7.43.0.2'
+release = '7.43.0.3'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pycurl-7.43.0.2/doc/docstrings/multi_remove_handle.rst 
new/pycurl-7.43.0.3/doc/docstrings/multi_remove_handle.rst
--- old/pycurl-7.43.0.2/doc/docstrings/multi_remove_handle.rst  2017-12-03 
20:03:17.000000000 +0100
+++ new/pycurl-7.43.0.3/doc/docstrings/multi_remove_handle.rst  2018-06-13 
20:07:03.000000000 +0200
@@ -3,9 +3,5 @@
 Corresponds to `curl_multi_remove_handle`_ in libcurl. This method
 removes an existing and valid Curl object from the CurlMulti object.
 
-IMPORTANT NOTE: remove_handle does not implicitly remove a Python reference
-from the Curl object (and thus does not decrease the reference count on the
-Curl object).
-
 .. _curl_multi_remove_handle:
     https://curl.haxx.se/libcurl/c/curl_multi_remove_handle.html
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycurl-7.43.0.2/doc/release-process.rst 
new/pycurl-7.43.0.3/doc/release-process.rst
--- old/pycurl-7.43.0.2/doc/release-process.rst 2018-06-02 06:59:02.000000000 
+0200
+++ new/pycurl-7.43.0.3/doc/release-process.rst 2018-06-13 20:07:03.000000000 
+0200
@@ -23,11 +23,11 @@
 13. Build windows packages using winbuild.py.
 14. Add sdist and windows packages to downloads repo on github.
 15. Tag the new version.
-16. Register new version with pypi - ``python setup.py register``.
-17. Upload source distribution to pypi using twine.
-18. Upload windows wheels to pypi using twine.
-19. Upload windows exe installers to pypi using twine.
-20. Upload release files to bintray.
-21. Push tag to github pycurl repo.
-22. Announce release on mailing list.
-23. Link to announcement from website.
+16. Upload source distribution to pypi using twine.
+17. Upload windows wheels to pypi using twine.
+18. Upload windows exe installers to pypi using twine.
+19. Upload release files to bintray.
+20. Push tag to github pycurl repo.
+21. Generate and upload documentation to web site.
+22. Update web site home page.
+23. Announce release on mailing list.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycurl-7.43.0.2/doc/thread-safety.rst 
new/pycurl-7.43.0.3/doc/thread-safety.rst
--- old/pycurl-7.43.0.2/doc/thread-safety.rst   2017-12-03 20:03:17.000000000 
+0100
+++ new/pycurl-7.43.0.3/doc/thread-safety.rst   2019-06-17 07:14:58.000000000 
+0200
@@ -21,7 +21,7 @@
   Python code *outside of a libcurl callback for the PycURL object in question*
   is unsafe.
 
-PycURL handles the necessary SSL locks for OpenSSL/LibreSSL, GnuTLS and NSS.
+PycURL handles the necessary SSL locks for OpenSSL/LibreSSL, GnuTLS, NSS and 
mbedTLS.
 
 A special situation exists when libcurl uses the standard C library
 name resolver (i.e., not threaded nor c-ares resolver). By default libcurl
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycurl-7.43.0.2/pycurl.egg-info/PKG-INFO 
new/pycurl-7.43.0.3/pycurl.egg-info/PKG-INFO
--- old/pycurl-7.43.0.2/pycurl.egg-info/PKG-INFO        2018-06-02 
06:59:34.000000000 +0200
+++ new/pycurl-7.43.0.3/pycurl.egg-info/PKG-INFO        2019-06-17 
07:56:09.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: pycurl
-Version: 7.43.0.2
+Version: 7.43.0.3
 Summary: PycURL -- A Python Interface To The cURL library
 Home-page: http://pycurl.io/
 Author: Oleg Pudeyev
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycurl-7.43.0.2/python/curl/__init__.py 
new/pycurl-7.43.0.3/python/curl/__init__.py
--- old/pycurl-7.43.0.2/python/curl/__init__.py 2017-12-03 20:03:17.000000000 
+0100
+++ new/pycurl-7.43.0.3/python/curl/__init__.py 2019-06-17 07:03:13.000000000 
+0200
@@ -34,16 +34,16 @@
 
 class Curl:
     "High-level interface to pycurl functions."
-    def __init__(self, base_url="", fakeheaders=[]):
+    def __init__(self, base_url="", fakeheaders=None):
         self.handle = pycurl.Curl()
         # These members might be set.
         self.set_url(base_url)
         self.verbosity = 0
-        self.fakeheaders = fakeheaders
+        self.fakeheaders = fakeheaders or []
         # Nothing past here should be modified by the caller.
         self.payload = None
         self.payload_io = BytesIO()
-        self.hrd = ""
+        self.hdr = ""
         # Verify that we've got the right site; harmless on a non-SSL connect.
         self.set_option(pycurl.SSL_VERIFYHOST, 2)
         # Follow redirects in case it wants to take us to a CGI...
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycurl-7.43.0.2/setup.py new/pycurl-7.43.0.3/setup.py
--- old/pycurl-7.43.0.2/setup.py        2018-06-02 06:59:02.000000000 +0200
+++ new/pycurl-7.43.0.3/setup.py        2019-06-17 07:52:05.000000000 +0200
@@ -6,7 +6,7 @@
 
 PACKAGE = "pycurl"
 PY_PACKAGE = "curl"
-VERSION = "7.43.0.2"
+VERSION = "7.43.0.3"
 
 import glob, os, re, sys, subprocess
 import distutils
@@ -42,38 +42,39 @@
     i = 1
     while i < len(argv):
         arg = argv[i]
-        if str.find(arg, s) == 0:
-            if s.endswith('='):
+        if s.endswith('='):
+            if str.find(arg, s) == 0:
                 # --option=value
                 p = arg[len(s):]
                 if s != '--openssl-lib-name=':
                     assert p, arg
+                del argv[i]
             else:
+                i += 1
+        else:
+            if s == arg:
                 # --option
                 # set value to True
                 p = True
-            del argv[i]
-        else:
-            i = i + 1
+                del argv[i]
+            else:
+                i = i + 1
     ##print argv
     return p
 
 
 def scan_argvs(argv, s):
+    if not s.endswith('='):
+        raise Exception('specification must end with =')
     p = []
     i = 1
     while i < len(argv):
         arg = argv[i]
         if str.find(arg, s) == 0:
-            if s.endswith('='):
-                # --option=value
-                p.append(arg[len(s):])
-                if s != '--openssl-lib-name=':
-                    assert p[-1], arg
-            else:
-                # --option
-                # set value to True
-                raise Exception('specification must end with =')
+            # --option=value
+            p.append(arg[len(s):])
+            if s != '--openssl-lib-name=':
+                assert p[-1], arg
             del argv[i]
         else:
             i = i + 1
@@ -95,6 +96,7 @@
         self.extra_objects = []
         self.extra_compile_args = []
         self.extra_link_args = []
+        self.ssl_lib_detected = None
 
         self.configure()
 
@@ -143,6 +145,7 @@
             '--with-ssl': self.using_openssl,
             '--with-gnutls': self.using_gnutls,
             '--with-nss': self.using_nss,
+            '--with-mbedtls': self.using_mbedtls,
         }
 
     def detect_ssl_option(self):
@@ -152,31 +155,30 @@
                     if option != other_option:
                         if scan_argv(self.argv, other_option) is not None:
                             raise ConfigurationError('Cannot give both %s and 
%s' % (option, other_option))
-                
+
                 return option
 
     def detect_ssl_backend(self):
-        ssl_lib_detected = False
-        
+        ssl_lib_detected = None
+
         if 'PYCURL_SSL_LIBRARY' in os.environ:
             ssl_lib = os.environ['PYCURL_SSL_LIBRARY']
-            if ssl_lib in ['openssl', 'gnutls', 'nss']:
-                ssl_lib_detected = True
+            if ssl_lib in ['openssl', 'gnutls', 'nss', 'mbedtls']:
+                ssl_lib_detected = ssl_lib
                 getattr(self, 'using_%s' % ssl_lib)()
             else:
                 raise ConfigurationError('Invalid value "%s" for 
PYCURL_SSL_LIBRARY' % ssl_lib)
-        
+
         option = self.detect_ssl_option()
         if option:
-            ssl_lib_detected = True
+            ssl_lib_detected = option.replace('--with-', '')
             self.ssl_options()[option]()
 
         # ssl detection - ssl libraries are added
         if not ssl_lib_detected:
             libcurl_dll_path = scan_argv(self.argv, "--libcurl-dll=")
             if libcurl_dll_path is not None:
-                if self.detect_ssl_lib_from_libcurl_dll(libcurl_dll_path):
-                    ssl_lib_detected = True
+                ssl_lib_detected = 
self.detect_ssl_lib_from_libcurl_dll(libcurl_dll_path)
 
         if not ssl_lib_detected:
             # self.sslhintbuf is a hack
@@ -184,15 +186,19 @@
                 if arg[:2] == "-l":
                     if arg[2:] == 'ssl':
                         self.using_openssl()
-                        ssl_lib_detected = True
+                        ssl_lib_detected = 'openssl'
                         break
                     if arg[2:] == 'gnutls':
                         self.using_gnutls()
-                        ssl_lib_detected = True
+                        ssl_lib_detected = 'gnutls'
                         break
                     if arg[2:] == 'ssl3':
                         self.using_nss()
-                        ssl_lib_detected = True
+                        ssl_lib_detected = 'nss'
+                        break
+                    if arg[2:] == 'mbedtls':
+                        self.using_mbedtls()
+                        ssl_lib_detected = 'mbedtls'
                         break
 
         if not ssl_lib_detected and len(self.argv) == len(self.original_argv) \
@@ -201,7 +207,7 @@
             # this path should only be taken when no options or
             # configuration environment variables are given to setup.py
             ssl_lib_detected = self.detect_ssl_lib_on_centos6()
-            
+
         self.ssl_lib_detected = ssl_lib_detected
 
     def curl_config(self):
@@ -301,19 +307,21 @@
             if errtext:
                 msg += ":\n" + errtext
             raise ConfigurationError(msg)
-            
+
         # hack
         self.sslhintbuf = sslhintbuf
 
         self.detect_features()
+        self.ssl_lib_detected = None
         if self.curl_has_ssl:
             self.detect_ssl_backend()
 
             if not self.ssl_lib_detected:
-                raise ConfigurationError('''\
-Curl is configured to use SSL, but we have not been able to determine \
-which SSL backend it is using. Please see PycURL documentation for how to \
-specify the SSL backend manually.''')
+                sys.stderr.write('''\
+Warning: libcurl is configured to use SSL, but we have not been able to \
+determine which SSL backend it is using. If your Curl is built against \
+OpenSSL, LibreSSL, BoringSSL, GnuTLS, NSS or mbedTLS please specify the SSL 
backend \
+manually. For other SSL backends please ignore this message.''')
         else:
             if self.detect_ssl_option():
                 sys.stderr.write("Warning: SSL backend specified manually but 
libcurl does not use SSL\n")
@@ -327,7 +335,7 @@
                 self.library_dirs.append(arg[2:])
             else:
                 self.extra_link_args.append(arg)
-            
+
         if not self.libraries:
             self.libraries.append("curl")
 
@@ -339,7 +347,7 @@
         self.check_avoid_stdio()
 
     def detect_ssl_lib_from_libcurl_dll(self, libcurl_dll_path):
-        ssl_lib_detected = False
+        ssl_lib_detected = None
         curl_version_info = self.get_curl_version_info(libcurl_dll_path)
         ssl_version = curl_version_info.ssl_version
         if py3:
@@ -347,13 +355,16 @@
             ssl_version = ssl_version.decode('ascii')
         if ssl_version.startswith('OpenSSL/') or 
ssl_version.startswith('LibreSSL/'):
             self.using_openssl()
-            ssl_lib_detected = True
+            ssl_lib_detected = 'openssl'
         elif ssl_version.startswith('GnuTLS/'):
             self.using_gnutls()
-            ssl_lib_detected = True
+            ssl_lib_detected = 'gnutls'
         elif ssl_version.startswith('NSS/'):
             self.using_nss()
-            ssl_lib_detected = True
+            ssl_lib_detected = 'nss'
+        elif ssl_version.startswith('mbedTLS/'):
+            self.using_mbedtls()
+            ssl_lib_detected = 'mbedtls'
         return ssl_lib_detected
 
     def detect_ssl_lib_on_centos6(self):
@@ -505,6 +516,11 @@
         self.libraries.append('ssl3')
         self.define_macros.append(('HAVE_CURL_SSL', 1))
 
+    def using_mbedtls(self):
+        self.define_macros.append(('HAVE_CURL_MBEDTLS', 1))
+        self.libraries.append('mbedtls')
+        self.define_macros.append(('HAVE_CURL_SSL', 1))
+
 def get_bdist_msi_version_hack():
     # workaround for distutils/msi version requirement per
     # epydoc.sourceforge.net/stdlib/distutils.version.StrictVersion-class.html 
-
@@ -553,6 +569,14 @@
 
 ###############################################################################
 
+PRETTY_SSL_LIBS = {
+    # setup.py may be detecting BoringSSL properly, need to test
+    'openssl': 'OpenSSL/LibreSSL/BoringSSL',
+    'gnutls': 'GnuTLS',
+    'nss': 'NSS',
+    'mbedtls': 'mbedTLS',
+}
+
 def get_extension(argv, split_extension_source=False):
     if split_extension_source:
         sources = [
@@ -580,6 +604,12 @@
         ]
         depends = []
     ext_config = ExtensionConfiguration(argv)
+
+    if ext_config.ssl_lib_detected:
+        print('Using SSL library: %s' % 
PRETTY_SSL_LIBS[ext_config.ssl_lib_detected])
+    else:
+        print('Not using an SSL library')
+
     ext = Extension(
         name=PACKAGE,
         sources=sources,
@@ -871,6 +901,7 @@
  --with-ssl                          legacy alias for --with-openssl
  --with-gnutls                       libcurl is linked against GnuTLS
  --with-nss                          libcurl is linked against NSS
+ --with-mbedtls                      libcurl is linked against mbedTLS
 '''
 
 windows_help = '''\
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycurl-7.43.0.2/src/docstrings.c 
new/pycurl-7.43.0.3/src/docstrings.c
--- old/pycurl-7.43.0.2/src/docstrings.c        2018-06-02 06:59:23.000000000 
+0200
+++ new/pycurl-7.43.0.3/src/docstrings.c        2019-06-17 07:52:49.000000000 
+0200
@@ -525,10 +525,6 @@
 Corresponds to `curl_multi_remove_handle`_ in libcurl. This method\n\
 removes an existing and valid Curl object from the CurlMulti object.\n\
 \n\
-IMPORTANT NOTE: remove_handle does not implicitly remove a Python reference\n\
-from the Curl object (and thus does not decrease the reference count on the\n\
-Curl object).\n\
-\n\
 .. _curl_multi_remove_handle:\n\
     https://curl.haxx.se/libcurl/c/curl_multi_remove_handle.html";;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycurl-7.43.0.2/src/easy.c 
new/pycurl-7.43.0.3/src/easy.c
--- old/pycurl-7.43.0.2/src/easy.c      2018-05-23 20:34:47.000000000 +0200
+++ new/pycurl-7.43.0.3/src/easy.c      2019-06-17 07:32:35.000000000 +0200
@@ -74,12 +74,6 @@
         return (-1);
     }
 
-    /* Set FTP_ACCOUNT to NULL by default */
-    res = curl_easy_setopt(self->handle, CURLOPT_FTP_ACCOUNT, NULL);
-    if (res != CURLE_OK) {
-        return (-1);
-    }
-
     /* Set default USERAGENT */
     assert(g_pycurl_useragent);
     res = curl_easy_setopt(self->handle, CURLOPT_USERAGENT, 
g_pycurl_useragent);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycurl-7.43.0.2/src/easyinfo.c 
new/pycurl-7.43.0.3/src/easyinfo.c
--- old/pycurl-7.43.0.2/src/easyinfo.c  2018-05-23 07:08:32.000000000 +0200
+++ new/pycurl-7.43.0.3/src/easyinfo.c  2019-06-17 07:14:54.000000000 +0200
@@ -277,6 +277,7 @@
         if (decoded_item == NULL) {
             goto err;
         }
+       PyList_SetItem(decoded_list, i, decoded_item);
     }
     
     return decoded_list;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycurl-7.43.0.2/src/easyopt.c 
new/pycurl-7.43.0.3/src/easyopt.c
--- old/pycurl-7.43.0.2/src/easyopt.c   2018-05-23 20:34:47.000000000 +0200
+++ new/pycurl-7.43.0.3/src/easyopt.c   2019-06-17 07:14:54.000000000 +0200
@@ -521,7 +521,7 @@
 
             if (PyText_AsStringAndSize(httppost_option, &cstr, &clen, 
&cencoded_obj)) {
                 PyText_EncodedDecref(nencoded_obj);
-                CURLERROR_SET_RETVAL();
+                create_and_set_error_object(self, CURLE_BAD_FUNCTION_ARGUMENT);
                 goto error;
             }
             /* INFO: curl_formadd() internally does memdup() the data, so
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycurl-7.43.0.2/src/module.c 
new/pycurl-7.43.0.3/src/module.c
--- old/pycurl-7.43.0.2/src/module.c    2018-05-23 20:34:47.000000000 +0200
+++ new/pycurl-7.43.0.3/src/module.c    2019-06-17 07:14:58.000000000 +0200
@@ -328,7 +328,7 @@
     PyObject *collections_module = NULL;
     PyObject *named_tuple = NULL;
     PyObject *arglist = NULL;
-    
+
     assert(Curl_Type.tp_weaklistoffset > 0);
     assert(CurlMulti_Type.tp_weaklistoffset > 0);
     assert(CurlShare_Type.tp_weaklistoffset > 0);
@@ -355,6 +355,8 @@
         runtime_ssl_lib = "gnutls";
     } else if (!strncmp(vi->ssl_version, "NSS/", 4)) {
         runtime_ssl_lib = "nss";
+    } else if (!strncmp(vi->ssl_version, "mbedTLS/", 8)) {
+        runtime_ssl_lib = "mbedtls";
     } else {
         runtime_ssl_lib = "none/other";
     }
@@ -461,7 +463,7 @@
     /* constants for ioctl callback argument values */
     insint_c(d, "IOCMD_NOP", CURLIOCMD_NOP);
     insint_c(d, "IOCMD_RESTARTREAD", CURLIOCMD_RESTARTREAD);
-    
+
     /* opensocketfunction return value */
     insint_c(d, "SOCKET_BAD", CURL_SOCKET_BAD);
 
@@ -1039,6 +1041,10 @@
 #if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 47, 0)
     insint_c(d, "CURL_HTTP_VERSION_2TLS", CURL_HTTP_VERSION_2TLS);
 #endif
+#if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 49, 0)
+    insint_c(d, "CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE", 
CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE);
+    insint_c(d, "TCP_FASTOPEN", CURLOPT_TCP_FASTOPEN);
+#endif
     insint_c(d, "CURL_HTTP_VERSION_LAST", CURL_HTTP_VERSION_LAST);
 
     /* CURL_NETRC_OPTION: constants for setopt(NETRC, x) */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycurl-7.43.0.2/src/multi.c 
new/pycurl-7.43.0.3/src/multi.c
--- old/pycurl-7.43.0.2/src/multi.c     2018-05-22 05:44:40.000000000 +0200
+++ new/pycurl-7.43.0.3/src/multi.c     2019-06-17 07:14:54.000000000 +0200
@@ -627,8 +627,8 @@
     assert(obj->multi_stack == NULL);
     res = curl_multi_add_handle(self->multi_handle, obj->handle);
     if (res != CURLM_OK) {
-        CURLERROR_MSG("curl_multi_add_handle() failed due to internal errors");
         PyDict_DelItem(self->easy_object_dict, (PyObject *) obj);
+        CURLERROR_MSG("curl_multi_add_handle() failed due to internal errors");
     }
     obj->multi_stack = self;
     Py_INCREF(self);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycurl-7.43.0.2/src/pycurl.h 
new/pycurl-7.43.0.3/src/pycurl.h
--- old/pycurl-7.43.0.2/src/pycurl.h    2018-05-23 20:34:47.000000000 +0200
+++ new/pycurl-7.43.0.3/src/pycurl.h    2019-06-17 07:14:58.000000000 +0200
@@ -174,6 +174,11 @@
 #   define COMPILE_SSL_LIB "gnutls"
 # elif defined(HAVE_CURL_NSS)
 #   define COMPILE_SSL_LIB "nss"
+# elif defined(HAVE_CURL_MBEDTLS)
+#   include <mbedtls/ssl.h>
+#   define PYCURL_NEED_SSL_TSL
+#   define PYCURL_NEED_MBEDTLS_TSL
+#   define COMPILE_SSL_LIB "mbedtls"
 # else
 #  ifdef _MSC_VER
     /* sigh */
@@ -190,7 +195,7 @@
    /* since we have no crypto callbacks for other ssl backends,
     * no reason to require users match those */
 #  define COMPILE_SSL_LIB "none/other"
-# endif /* HAVE_CURL_OPENSSL || HAVE_CURL_GNUTLS || HAVE_CURL_NSS */
+# endif /* HAVE_CURL_OPENSSL || HAVE_CURL_GNUTLS || HAVE_CURL_NSS || 
HAVE_CURL_MBEDTLS */
 #else
 # define COMPILE_SSL_LIB "none/other"
 #endif /* HAVE_CURL_SSL */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycurl-7.43.0.2/src/threadsupport.c 
new/pycurl-7.43.0.3/src/threadsupport.c
--- old/pycurl-7.43.0.2/src/threadsupport.c     2018-05-19 02:47:45.000000000 
+0200
+++ new/pycurl-7.43.0.3/src/threadsupport.c     2019-06-17 07:14:58.000000000 
+0200
@@ -232,6 +232,45 @@
 }
 #endif
 
+/* mbedTLS */
+
+#ifdef PYCURL_NEED_MBEDTLS_TSL
+static int
+pycurl_ssl_mutex_create(void **m)
+{
+    if ((*((PyThread_type_lock *) m) = PyThread_allocate_lock()) == NULL) {
+        return -1;
+    } else {
+        return 0;
+    }
+}
+
+static int
+pycurl_ssl_mutex_destroy(void **m)
+{
+    PyThread_free_lock(*((PyThread_type_lock *) m));
+    return 0;
+}
+
+static int
+pycurl_ssl_mutex_lock(void **m)
+{
+    return !PyThread_acquire_lock(*((PyThread_type_lock *) m), 1);
+}
+
+PYCURL_INTERNAL int
+pycurl_ssl_init(void)
+{
+    return 0;
+}
+
+PYCURL_INTERNAL void
+pycurl_ssl_cleanup(void)
+{
+    return;
+}
+#endif
+
 /*************************************************************************
 // CurlShareObject
 **************************************************************************/
Binary files old/pycurl-7.43.0.2/tests/fake-curl/libcurl/with_gnutls.so and 
new/pycurl-7.43.0.3/tests/fake-curl/libcurl/with_gnutls.so differ
Binary files old/pycurl-7.43.0.2/tests/fake-curl/libcurl/with_nss.so and 
new/pycurl-7.43.0.3/tests/fake-curl/libcurl/with_nss.so differ
Binary files old/pycurl-7.43.0.2/tests/fake-curl/libcurl/with_openssl.so and 
new/pycurl-7.43.0.3/tests/fake-curl/libcurl/with_openssl.so differ
Binary files old/pycurl-7.43.0.2/tests/fake-curl/libcurl/with_unknown_ssl.so 
and new/pycurl-7.43.0.3/tests/fake-curl/libcurl/with_unknown_ssl.so differ
Binary files old/pycurl-7.43.0.2/tests/fake-curl/libcurl/without_ssl.so and 
new/pycurl-7.43.0.3/tests/fake-curl/libcurl/without_ssl.so differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycurl-7.43.0.2/tests/option_constants_test.py 
new/pycurl-7.43.0.3/tests/option_constants_test.py
--- old/pycurl-7.43.0.2/tests/option_constants_test.py  2018-06-02 
06:14:57.000000000 +0200
+++ new/pycurl-7.43.0.3/tests/option_constants_test.py  2019-06-17 
07:03:13.000000000 +0200
@@ -455,6 +455,11 @@
     def test_http_version_2tls(self):
         self.curl.setopt(self.curl.HTTP_VERSION, 
self.curl.CURL_HTTP_VERSION_2TLS)
 
+    @nose.plugins.attrib.attr('http2')
+    @util.min_libcurl(7, 49, 0)
+    def test_http_version_2prior_knowledge(self):
+        self.curl.setopt(self.curl.HTTP_VERSION, 
self.curl.CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE)
+
     @util.min_libcurl(7, 21, 5)
     def test_sockopt_constants(self):
         assert self.curl.SOCKOPT_OK is not None
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycurl-7.43.0.2/tests/setup_test.py 
new/pycurl-7.43.0.3/tests/setup_test.py
--- old/pycurl-7.43.0.2/tests/setup_test.py     2018-06-02 06:14:57.000000000 
+0200
+++ new/pycurl-7.43.0.3/tests/setup_test.py     2018-06-13 20:07:03.000000000 
+0200
@@ -69,6 +69,24 @@
         assert 'curl' in config.libraries
 
     @util.only_unix
+    def test_valid_option_consumes_argv(self):
+        argv = ['', '--with-nss']
+        pycurl_setup.ExtensionConfiguration(argv)
+        self.assertEqual([''], argv)
+
+    @util.only_unix
+    def test_invalid_option_not_consumed(self):
+        argv = ['', '--bogus']
+        pycurl_setup.ExtensionConfiguration(argv)
+        self.assertEqual(['', '--bogus'], argv)
+
+    @util.only_unix
+    def test_invalid_option_suffix_not_consumed(self):
+        argv = ['', '--with-nss-bogus']
+        pycurl_setup.ExtensionConfiguration(argv)
+        self.assertEqual(['', '--with-nss-bogus'], argv)
+
+    @util.only_unix
     @using_curl_config('curl-config-empty')
     def test_no_ssl(self):
         config = pycurl_setup.ExtensionConfiguration()
@@ -129,15 +147,17 @@
     @util.only_unix
     @using_curl_config('curl-config-ssl-feature-only')
     def test_ssl_feature_only(self):
+        saved_stderr = sys.stderr
+        sys.stderr = captured_stderr = StringIO()
         try:
-            pycurl_setup.ExtensionConfiguration()
-        except pycurl_setup.ConfigurationError as e:
-            self.assertEqual('''\
-Curl is configured to use SSL, but we have not been able to determine \
-which SSL backend it is using. Please see PycURL documentation for how to \
-specify the SSL backend manually.''', str(e))
-        else:
-            self.fail('Should have raised')
+            config = pycurl_setup.ExtensionConfiguration()
+        finally:
+            sys.stderr = saved_stderr
+        # ssl define should be on
+        assert 'HAVE_CURL_SSL' in config.define_symbols
+        # and a warning message
+        assert 'Warning: libcurl is configured to use SSL, but we have \
+not been able to determine which SSL backend it is using.' in 
captured_stderr.getvalue()
 
     @util.only_unix
     @using_curl_config('curl-config-ssl-feature-only')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pycurl-7.43.0.2/winbuild.py 
new/pycurl-7.43.0.3/winbuild.py
--- old/pycurl-7.43.0.2/winbuild.py     2018-06-02 06:59:02.000000000 +0200
+++ new/pycurl-7.43.0.3/winbuild.py     2019-06-17 07:52:10.000000000 +0200
@@ -91,7 +91,7 @@
     # whether to build binary wheels
     build_wheels = True
     # pycurl version to build, we should know this ourselves
-    pycurl_version = '7.43.0.2'
+    pycurl_version = '7.43.0.3'
 
     # sometimes vc14 does not include windows sdk path in vcvars which breaks 
stuff.
     # another application for this is to supply normaliz.lib for vc9
@@ -269,6 +269,7 @@
     '3.4': 'vc10',
     '3.5': 'vc14',
     '3.6': 'vc14',
+    '3.7': 'vc14',
 }
 
 def mkdir_p(path):

++++++ python-pycurl-7.43.0-tls-backend.patch ++++++
--- /var/tmp/diff_new_pack.6idyEJ/_old  2019-07-30 13:05:38.462383979 +0200
+++ /var/tmp/diff_new_pack.6idyEJ/_new  2019-07-30 13:05:38.462383979 +0200
@@ -11,10 +11,10 @@
  src/module.c | 20 +-------------------
  1 file changed, 1 insertion(+), 19 deletions(-)
 
-diff --git a/src/module.c b/src/module.c
-index a7108a0..af79875 100644
---- a/src/module.c
-+++ b/src/module.c
+Index: pycurl-7.43.0.3/src/module.c
+===================================================================
+--- pycurl-7.43.0.3.orig/src/module.c
++++ pycurl-7.43.0.3/src/module.c
 @@ -322,7 +322,7 @@ initpycurl(void)
  {
      PyObject *m, *d;
@@ -24,7 +24,7 @@
      size_t libcurl_version_len, pycurl_version_len;
      PyObject *xio_module = NULL;
      PyObject *collections_module = NULL;
-@@ -345,24 +345,6 @@ initpycurl(void)
+@@ -345,26 +345,6 @@ initpycurl(void)
          goto error;
      }
  
@@ -38,6 +38,8 @@
 -        runtime_ssl_lib = "gnutls";
 -    } else if (!strncmp(vi->ssl_version, "NSS/", 4)) {
 -        runtime_ssl_lib = "nss";
+-    } else if (!strncmp(vi->ssl_version, "mbedTLS/", 8)) {
+-        runtime_ssl_lib = "mbedtls";
 -    } else {
 -        runtime_ssl_lib = "none/other";
 -    }
@@ -49,6 +51,3 @@
      /* Initialize the type of the new type objects here; doing it here
       * is required for portability to Windows without requiring C++. */
      p_Curl_Type = &Curl_Type;
--- 
-2.10.2
-


Reply via email to