[Python-modules-commits] [pycurl] 11/140: Import pycurl_7.13.2.orig.tar.gz

Barry Warsaw barry at moszumanska.debian.org
Wed Oct 1 21:45:00 UTC 2014


This is an automated email from the git hooks/post-receive script.

barry pushed a commit to branch master
in repository pycurl.

commit d9b601139a2cec5a81084dcead61ef9778ba6165
Author: Barry Warsaw <barry at python.org>
Date:   Wed Oct 1 16:43:22 2014 -0400

    Import pycurl_7.13.2.orig.tar.gz
---
 ChangeLog                   | 23 ++++++++++++++++++++++-
 PKG-INFO                    |  2 +-
 TODO                        |  4 +++-
 doc/curlmultiobject.html    |  6 +++---
 examples/linksys.py         | 17 +++++++++--------
 examples/retriever-multi.py |  4 ++--
 examples/sfquery.py         |  5 +++--
 setup.py                    |  4 ++--
 setup_win32_ssl.py          |  2 +-
 src/pycurl.c                | 36 +++++++++++++++++-------------------
 tests/test_gtk.py           | 39 ++++++++++++++++++++++-----------------
 tests/test_multi.py         |  4 ++--
 tests/test_multi2.py        |  4 ++--
 tests/test_multi3.py        |  4 ++--
 tests/test_multi4.py        |  4 ++--
 tests/test_multi5.py        |  4 ++--
 tests/test_multi6.py        |  4 ++--
 17 files changed, 97 insertions(+), 69 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0e5ae7e..13f4a60 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,25 @@
-Version 7.13.1 [requires libcurl-7.13.1 or better]
+Version 7.13.2 [requires libcurl-7.13.2 or better]
+--------------
+
+2005-03-30  Kjetil Jacobsen  <kjetilja>
+
+        * Unbreak tests/test_gtk.py and require pygtk >= 2.0.
+
+2005-03-15  Kjetil Jacobsen  <kjetilja>
+
+        * Cleaned up several of the examples.
+
+2005-03-11  Kjetil Jacobsen  <kjetilja>
+
+        * WARNING: multi.select() now requires the previously optional
+          timeout parameter.  Updated the tests and examples to reflect
+          this change.  If the timeout is not set, select could block
+          infinitely and cause problems for the internal timeout handling
+          in the multi stack.  The problem was identified by
+          <unknownsoldier93 at yahoo.com>.
+
+
+Version 7.13.1
 --------------
 
 2005-03-04  Kjetil Jacobsen  <kjetilja>
diff --git a/PKG-INFO b/PKG-INFO
index f0c0e97..a03341a 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: pycurl
-Version: 7.13.1
+Version: 7.13.2
 Summary: PycURL -- cURL library module for Python
 Home-page: http://pycurl.sourceforge.net/
 Author: Kjetil Jacobsen, Markus F.X.J. Oberhumer
diff --git a/TODO b/TODO
index 0ed534a..1da552d 100644
--- a/TODO
+++ b/TODO
@@ -1,4 +1,4 @@
-# $Id: TODO,v 1.95 2005/03/04 14:43:04 kjetilja Exp $
+# $Id: TODO,v 1.96 2005/03/06 14:03:07 kjetilja Exp $
 # vi:ts=4:et
 
 If you want to hack on pycurl, here's our list of unresolved issues:
@@ -6,6 +6,8 @@ If you want to hack on pycurl, here's our list of unresolved issues:
 
 NEW FEATURES/IMPROVEMENTS:
 
+    * Add all error constants to the pycurl namespace.
+
     * Add docs to the high-level interface.
 
     * Add more options to the undocumented and currently mostly useless
diff --git a/doc/curlmultiobject.html b/doc/curlmultiobject.html
index 812111d..8a9a986 100644
--- a/doc/curlmultiobject.html
+++ b/doc/curlmultiobject.html
@@ -83,7 +83,7 @@ while num_handles:
 </pre>
 </dd>
 
-<dt><code>select(</code><em>[timeout]</em><code>)</code> ->
+<dt><code>select(</code><em>timeout</em><code>)</code> ->
 <em>number of ready file descriptors or -1 on timeout</em></dt>
 <dd>
 <p>This is a convenience function which simplifies the combined
@@ -100,7 +100,7 @@ while 1:
     ret, num_handles = m.perform()
     if ret != pycurl.E_CALL_MULTI_PERFORM: break
 while num_handles:
-    ret = m.select()
+    ret = m.select(1.0)
     if ret == -1:  continue
     while 1:
         ret, num_handles = m.perform()
@@ -129,7 +129,7 @@ returned.</p>
   <a href="http://validator.w3.org/check/referer"><img align="right"
      src="http://www.w3.org/Icons/valid-xhtml10"
      alt="Valid XHTML 1.0!" height="31" width="88" border="0" /></a>
-  $Id: curlmultiobject.html,v 1.4 2004/06/05 17:59:01 mfx Exp $
+  $Id: curlmultiobject.html,v 1.5 2005/03/11 13:32:12 kjetilja Exp $
 </p>
 
 </body>
diff --git a/examples/linksys.py b/examples/linksys.py
index a60eba1..5304886 100755
--- a/examples/linksys.py
+++ b/examples/linksys.py
@@ -220,6 +220,7 @@ if __name__ == "__main__":
     class LinksysInterpreter(cmd.Cmd):
         """Interpret commands to perform LinkSys programming actions."""
         def __init__(self):
+            cmd.Cmd.__init__(self)
             self.session = LinksysSession()
             if os.isatty(0):
                 import readline
@@ -229,7 +230,7 @@ if __name__ == "__main__":
                 self.prompt = ""
                 print "Bar1"
 
-        def flag_command(self, func):
+        def flag_command(self, func, line):
             if line.strip() in ("on", "enable", "yes"):
                 func(True)
             elif line.strip() in ("off", "disable", "no"):
@@ -268,7 +269,7 @@ if __name__ == "__main__":
             print "the box is responding correctly."
 
         def do_verbose(self, line):
-            self.flag_command(self.session.set_verbosity)
+            self.flag_command(self.session.set_verbosity, line)
         def help_verbose(self):
             print "Usage: verbose {on|off|enable|disable|yes|no}"
             print "Enables display of HTTP requests."
@@ -302,7 +303,7 @@ if __name__ == "__main__":
             print "Sets the LAN subnetwork mask."
 
         def do_wireless(self, line):
-            self.flag_command(self.session.set_wireless)
+            self.flag_command(self.session.set_wireless, line)
             return 0
         def help_wireless(self):
             print "Usage: wireless {on|off|enable|disable|yes|no}"
@@ -316,7 +317,7 @@ if __name__ == "__main__":
             print "Sets the SSID used to control wireless access."
 
         def do_ssid_broadcast(self, line):
-            self.flag_command(self.session.set_SSID_broadcast)
+            self.flag_command(self.session.set_SSID_broadcast, line)
             return 0
         def help_ssid_broadcast(self):
             print "Usage: ssid_broadcast {on|off|enable|disable|yes|no}"
@@ -330,7 +331,7 @@ if __name__ == "__main__":
             print "Sets the wireless channel."
 
         def do_wep(self, line):
-            self.flag_command(self.session.set_WEP)
+            self.flag_command(self.session.set_WEP, line)
             return 0
         def help_wep(self):
             print "Usage: wep {on|off|enable|disable|yes|no}"
@@ -387,7 +388,7 @@ if __name__ == "__main__":
             print "Sets the router password."
 
         def do_upnp(self, line):
-            self.flag_command(self.session.set_UPnP)
+            self.flag_command(self.session.set_UPnP, line)
             return 0
         def help_upnp(self):
             print "Usage: upnp {on|off|enable|disable|yes|no}"
@@ -400,7 +401,7 @@ if __name__ == "__main__":
             print "Reset Linksys settings to factory defaults."
 
         def do_dhcp(self, line):
-            self.flag_command(self.session.set_DHCP)
+            self.flag_command(self.session.set_DHCP, line)
         def help_dhcp(self):
             print "Usage: dhcp {on|off|enable|disable|yes|no}"
             print "Switch to enable or disable DHCP features."
@@ -435,7 +436,7 @@ if __name__ == "__main__":
             print "Sets primary, secondary, or tertiary DNS server address."
 
         def do_logging(self, line):
-            self.flag_command(self.session.set_logging)
+            self.flag_command(self.session.set_logging, line)
         def help_logging(self):
             print "Usage: logging {on|off|enable|disable|yes|no}"
             print "Switch to enable or disable session logging."
diff --git a/examples/retriever-multi.py b/examples/retriever-multi.py
index 488d0f7..2bef26c 100644
--- a/examples/retriever-multi.py
+++ b/examples/retriever-multi.py
@@ -1,7 +1,7 @@
 #! /usr/bin/env python
 # -*- coding: iso-8859-1 -*-
 # vi:ts=4:et
-# $Id: retriever-multi.py,v 1.25 2005/02/13 08:28:01 mfx Exp $
+# $Id: retriever-multi.py,v 1.27 2005/03/15 13:10:30 kjetilja Exp $
 
 #
 # Usage: python retriever-multi.py <file with URLs to fetch> [<# of
@@ -109,7 +109,7 @@ while num_processed < num_urls:
     # Currently no more I/O is pending, could do something in the meantime
     # (display a progress bar, etc.).
     # We just call select() to sleep until some more data is available.
-    m.select()
+    m.select(1.0)
 
 
 # Cleanup
diff --git a/examples/sfquery.py b/examples/sfquery.py
index 0c63f61..741feb0 100644
--- a/examples/sfquery.py
+++ b/examples/sfquery.py
@@ -14,8 +14,6 @@
 import os, sys, netrc
 import curl
 
-assert sys.version[:3] >= "2.2", "requires Python 2.2 or better"
-
 class SourceForgeUserSession(curl.Curl):
     # SourceForge-specific methods.  Sensitive to changes in site design.
     def login(self, name, password):
@@ -41,6 +39,9 @@ if __name__ == "__main__":
         auth = netrc.netrc().authenticators("sourceforge.net")
         name, account, password = auth
     except:
+        if len(sys.argv) < 4:
+            print "Usage: %s <project id> <username> <password>" % sys.argv[0]
+            raise SystemExit
         name = sys.argv[2]
         password = sys.argv[3]
     session = SourceForgeUserSession("https://sourceforge.net/")
diff --git a/setup.py b/setup.py
index a9799db..d4a7430 100644
--- a/setup.py
+++ b/setup.py
@@ -7,7 +7,7 @@
 
 PACKAGE = "pycurl"
 PY_PACKAGE = "curl"
-VERSION = "7.13.1"
+VERSION = "7.13.2"
 
 import glob, os, re, sys, string
 import distutils
@@ -63,7 +63,7 @@ if sys.platform == "win32":
     # Windows users have to configure the CURL_DIR path parameter to match
     # their cURL source installation.  The path set here is just an example
     # and thus unlikely to match your installation.
-    CURL_DIR = r"c:\src\build\pycurl\curl-7.13.1"
+    CURL_DIR = r"c:\src\build\pycurl\curl-7.13.2"
     CURL_DIR = scan_argv("--curl-dir=", CURL_DIR)
     print "Using curl directory:", CURL_DIR
     assert os.path.isdir(CURL_DIR), "please check CURL_DIR in setup.py"
diff --git a/setup_win32_ssl.py b/setup_win32_ssl.py
index b900874..ca93146 100644
--- a/setup_win32_ssl.py
+++ b/setup_win32_ssl.py
@@ -7,7 +7,7 @@ import os, sys, string
 assert sys.platform == "win32", "Only for building on Win32 with SSL and zlib"
 
 
-CURL_DIR = r"c:\src\build\pycurl\curl-7.13.1-ssl"
+CURL_DIR = r"c:\src\build\pycurl\curl-7.13.2-ssl"
 OPENSSL_DIR = r"c:\src\build\pycurl\openssl-0.9.7e"
 sys.argv.insert(1, "--curl-dir=" + CURL_DIR)
 
diff --git a/src/pycurl.c b/src/pycurl.c
index 6f5f699..03566b6 100644
--- a/src/pycurl.c
+++ b/src/pycurl.c
@@ -1,4 +1,4 @@
-/* $Id: pycurl.c,v 1.86 2005/03/04 08:39:30 kjetilja Exp $ */
+/* $Id: pycurl.c,v 1.89 2005/03/30 17:35:55 mfx Exp $ */
 
 /* PycURL -- cURL Python module
  *
@@ -48,8 +48,8 @@
 #if !defined(PY_VERSION_HEX) || (PY_VERSION_HEX < 0x02020000)
 #  error "Need Python version 2.2 or greater to compile pycurl."
 #endif
-#if !defined(LIBCURL_VERSION_NUM) || (LIBCURL_VERSION_NUM < 0x070d01)
-#  error "Need libcurl version 7.13.1 or greater to compile pycurl."
+#if !defined(LIBCURL_VERSION_NUM) || (LIBCURL_VERSION_NUM < 0x070d02)
+#  error "Need libcurl version 7.13.2 or greater to compile pycurl."
 #endif
 
 #undef UNUSED
@@ -178,14 +178,16 @@ static PyObject *convert_slist(struct curl_slist *slist, int free_flags)
     for ( ; slist != NULL; slist = slist->next) {
         PyObject *v = NULL;
 
-        if (slist->data != NULL) {
+        if (slist->data == NULL) {
+            v = Py_None; Py_INCREF(v);
+        } else {
             v = PyString_FromString(slist->data);
-            if (v == NULL || PyList_Append(ret, v) != 0) {
-                Py_XDECREF(v);
-                goto error;
-            }
-            Py_DECREF(v);
         }
+        if (v == NULL || PyList_Append(ret, v) != 0) {
+            Py_XDECREF(v);
+            goto error;
+        }
+        Py_DECREF(v);
     }
 
     if ((free_flags & 1) && slist)
@@ -915,7 +917,7 @@ ioctl_callback(CURL *curlobj, int cmd, void *stream)
         goto silent_error;
 
     /* run callback */
-    arglist = Py_BuildValue("(i)", (int)cmd);
+    arglist = Py_BuildValue("(i)", cmd);
     if (arglist == NULL)
         goto verbose_error;
     result = PyEval_CallObject(self->ioctl_cb, arglist);
@@ -2025,20 +2027,17 @@ do_multi_select(CurlMultiObject *self, PyObject *args)
     struct timeval tv, *tvp;
     CURLMcode res;
 
-    if (!PyArg_ParseTuple(args, "|d:select", &timeout)) {
+    if (!PyArg_ParseTuple(args, "d:select", &timeout)) {
         return NULL;
     }
     if (check_multi_state(self, 1 | 2, "select") != 0) {
         return NULL;
     }
 
-   if (timeout == -1.0) {
-        /* no timeout given - wait forever */
-        tvp = NULL;
-   } else if (timeout < 0 || timeout >= 365 * 24 * 60 * 60) {
+    if (timeout < 0 || timeout >= 365 * 24 * 60 * 60) {
         PyErr_SetString(PyExc_OverflowError, "invalid timeout period");
         return NULL;
-   } else {
+    } else {
         long seconds = (long)timeout;
         timeout = timeout - (double)seconds;
         assert(timeout >= 0.0); assert(timeout < 1.0);
@@ -2293,7 +2292,6 @@ do_global_cleanup(PyObject *dummy)
 }
 
 
-
 static PyObject *vi_str(const char *s)
 {
     if (s == NULL) {
@@ -2325,8 +2323,8 @@ do_version_info(PyObject *dummy, PyObject *args)
         return NULL;
     }
 
-    /* Note: actually libcurl in lib/version.c does ignore
-     * the "stamp" parm, and so do we */
+    /* INFO: actually libcurl in lib/version.c does ignore
+     * the "stamp" parameter, and so do we. */
 
     for (i = 0; vi->protocols[i] != NULL; )
         i++;
diff --git a/tests/test_gtk.py b/tests/test_gtk.py
index b3c28c6..afde610 100644
--- a/tests/test_gtk.py
+++ b/tests/test_gtk.py
@@ -1,11 +1,13 @@
 #! /usr/bin/env python
 # -*- coding: iso-8859-1 -*-
 # vi:ts=4:et
-# $Id: test_gtk.py,v 1.23 2004/12/26 17:31:53 mfx Exp $
+# $Id: test_gtk.py,v 1.24 2005/03/30 12:05:50 kjetilja Exp $
 
 import sys, threading
-from gtk import *
 import pycurl
+import pygtk
+pygtk.require('2.0')
+import gtk
 
 # We should ignore SIGPIPE when using pycurl.NOSIGNAL - see
 # the libcurl tutorial for more info.
@@ -20,43 +22,42 @@ except ImportError:
 class ProgressBar:
     def __init__(self, uri):
         self.round = 0.0
-        win = GtkDialog()
+        win = gtk.Window(gtk.WINDOW_TOPLEVEL)
         win.set_title("PycURL progress")
         win.show()
-        vbox = GtkVBox(spacing=5)
+        vbox = gtk.VBox(spacing=5)
         vbox.set_border_width(10)
-        win.vbox.pack_start(vbox)
+        win.add(vbox)
         win.set_default_size(200, 20)
         vbox.show()
-        label = GtkLabel("Downloading %s" % uri)
+        label = gtk.Label("Downloading %s" % uri)
         label.set_alignment(0, 0.5)
-        vbox.pack_start(label, expand=FALSE)
+        vbox.pack_start(label)
         label.show()
-        pbar = GtkProgressBar()
+        pbar = gtk.ProgressBar()
         pbar.show()
         self.pbar = pbar
         vbox.pack_start(pbar)
         win.connect("destroy", self.close_app)
-        win.connect("delete_event", self.close_app)
 
     def progress(self, download_t, download_d, upload_t, upload_d):
-        threads_enter()
         if download_t == 0:
             self.round = self.round + 0.1
             if self.round >= 1.0:  self.round = 0.0
         else:
             self.round = float(download_d) / float(download_t)
-        self.pbar.update(self.round)
-        threads_leave()
+        gtk.threads_enter()
+        self.pbar.set_fraction(self.round)
+        gtk.threads_leave()
 
     def mainloop(self):
-        threads_enter()
-        mainloop()
-        threads_leave()
+        gtk.threads_enter()
+        gtk.main()
+        gtk.threads_leave()
 
     def close_app(self, *args):
         args[0].destroy()
-        mainquit()
+        gtk.main_quit()
 
 
 class Test(threading.Thread):
@@ -90,4 +91,8 @@ p = ProgressBar(sys.argv[1])
 # Start thread for fetching url
 Test(sys.argv[1], open(sys.argv[2], 'wb'), p.progress).start()
 # Enter the GTK mainloop
-p.mainloop()
+gtk.threads_init()
+try:
+    p.mainloop()
+except KeyboardInterrupt:
+    pass
diff --git a/tests/test_multi.py b/tests/test_multi.py
index 5be86f0..0082bf0 100644
--- a/tests/test_multi.py
+++ b/tests/test_multi.py
@@ -1,7 +1,7 @@
 #! /usr/bin/env python
 # -*- coding: iso-8859-1 -*-
 # vi:ts=4:et
-# $Id: test_multi.py,v 1.9 2003/04/21 18:46:10 mfx Exp $
+# $Id: test_multi.py,v 1.10 2005/03/11 13:24:45 kjetilja Exp $
 
 import pycurl
 
@@ -23,7 +23,7 @@ while num_handles:
         ret, num_handles = m.perform()
         if ret != pycurl.E_CALL_MULTI_PERFORM:
             break
-    m.select()
+    m.select(1.0)
 
 m.remove_handle(c2)
 m.remove_handle(c1)
diff --git a/tests/test_multi2.py b/tests/test_multi2.py
index 3d8ab1b..4ce741e 100644
--- a/tests/test_multi2.py
+++ b/tests/test_multi2.py
@@ -1,7 +1,7 @@
 #! /usr/bin/env python
 # -*- coding: iso-8859-1 -*-
 # vi:ts=4:et
-# $Id: test_multi2.py,v 1.13 2003/04/21 18:46:10 mfx Exp $
+# $Id: test_multi2.py,v 1.14 2005/03/11 13:24:45 kjetilja Exp $
 
 import os, sys
 try:
@@ -50,7 +50,7 @@ while num_handles:
              break
      # currently no more I/O is pending, could do something in the meantime
      # (display a progress bar, etc.)
-     m.select()
+     m.select(1.0)
 
 # close handles
 for c in m.handles:
diff --git a/tests/test_multi3.py b/tests/test_multi3.py
index 9b52159..244e04d 100644
--- a/tests/test_multi3.py
+++ b/tests/test_multi3.py
@@ -1,7 +1,7 @@
 #! /usr/bin/env python
 # -*- coding: iso-8859-1 -*-
 # vi:ts=4:et
-# $Id: test_multi3.py,v 1.12 2003/04/21 18:46:10 mfx Exp $
+# $Id: test_multi3.py,v 1.13 2005/03/11 13:24:45 kjetilja Exp $
 
 # same as test_multi2.py, but enforce some debugging and strange API-calls
 
@@ -51,7 +51,7 @@ while num_handles:
             break
     # currently no more I/O is pending, could do something in the meantime
     # (display a progress bar, etc.)
-    m.select()
+    m.select(1.0)
 
 # close handles
 for c in m.handles:
diff --git a/tests/test_multi4.py b/tests/test_multi4.py
index 6b143aa..886d356 100644
--- a/tests/test_multi4.py
+++ b/tests/test_multi4.py
@@ -1,7 +1,7 @@
 #! /usr/bin/env python
 # -*- coding: iso-8859-1 -*-
 # vi:ts=4:et
-# $Id: test_multi4.py,v 1.13 2003/04/21 18:46:10 mfx Exp $
+# $Id: test_multi4.py,v 1.14 2005/03/11 13:24:45 kjetilja Exp $
 
 import sys, select, time
 import pycurl
@@ -25,7 +25,7 @@ m.add_handle(c2)
 m.add_handle(c3)
 
 # Number of seconds to wait for a timeout to happen
-SELECT_TIMEOUT = 10
+SELECT_TIMEOUT = 1.0
 
 # Stir the state machine into action
 while 1:
diff --git a/tests/test_multi5.py b/tests/test_multi5.py
index 10f799e..b30d234 100644
--- a/tests/test_multi5.py
+++ b/tests/test_multi5.py
@@ -1,7 +1,7 @@
 #! /usr/bin/env python
 # -*- coding: iso-8859-1 -*-
 # vi:ts=4:et
-# $Id: test_multi5.py,v 1.11 2003/04/21 18:46:10 mfx Exp $
+# $Id: test_multi5.py,v 1.12 2005/03/11 13:24:45 kjetilja Exp $
 
 import sys, select, time
 import pycurl
@@ -25,7 +25,7 @@ m.add_handle(c2)
 m.add_handle(c3)
 
 # Number of seconds to wait for a timeout to happen
-SELECT_TIMEOUT = 10
+SELECT_TIMEOUT = 1.0
 
 # Stir the state machine into action
 while 1:
diff --git a/tests/test_multi6.py b/tests/test_multi6.py
index 77585e5..a7737a6 100644
--- a/tests/test_multi6.py
+++ b/tests/test_multi6.py
@@ -1,7 +1,7 @@
 #! /usr/bin/env python
 # -*- coding: iso-8859-1 -*-
 # vi:ts=4:et
-# $Id: test_multi6.py,v 1.5 2003/04/21 18:46:10 mfx Exp $
+# $Id: test_multi6.py,v 1.6 2005/03/11 13:24:45 kjetilja Exp $
 
 import sys, select, time
 import pycurl
@@ -25,7 +25,7 @@ m.add_handle(c2)
 m.add_handle(c3)
 
 # Number of seconds to wait for a timeout to happen
-SELECT_TIMEOUT = 10
+SELECT_TIMEOUT = 1.0
 
 # Stir the state machine into action
 while 1:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/pycurl.git



More information about the Python-modules-commits mailing list