[Python-modules-commits] [kombu] 01/05: Import kombu_3.0.30.orig.tar.gz

Brian May bam at moszumanska.debian.org
Mon Dec 7 10:25:36 UTC 2015


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

bam pushed a commit to branch master
in repository kombu.

commit a2b1b2e701b7299f7dc4c5dc4ad4662cb9ddfa67
Author: Brian May <bam at debian.org>
Date:   Mon Dec 7 21:10:46 2015 +1100

    Import kombu_3.0.30.orig.tar.gz
---
 AUTHORS                              | 10 +++--
 Changelog                            | 28 ++++++++++++
 PKG-INFO                             |  4 +-
 README.rst                           |  2 +-
 docs/changelog.rst                   | 28 ++++++++++++
 docs/introduction.rst                |  2 +-
 docs/userguide/pools.rst             |  2 +-
 docs/userguide/serialization.rst     |  4 +-
 extra/appveyor/install.ps1           | 85 ++++++++++++++++++++++++++++++++++++
 extra/appveyor/run_with_compiler.cmd | 47 ++++++++++++++++++++
 kombu.egg-info/PKG-INFO              |  4 +-
 kombu.egg-info/SOURCES.txt           |  2 +
 kombu/__init__.py                    |  2 +-
 kombu/async/hub.py                   | 35 ++++++++++++---
 kombu/transport/django/managers.py   |  2 +
 kombu/transport/qpid.py              |  9 +++-
 kombu/transport/redis.py             | 11 +++++
 kombu/utils/__init__.py              | 13 +++---
 18 files changed, 263 insertions(+), 27 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 4b3b471..a401354 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -49,10 +49,13 @@ Florian Munz <surf at theflow.de>
 Franck Cuny <fcuny at saymedia.com>
 Germán M. Bravo <german.mb at gmail.com>
 Gregory Haskins <greg at greghaskins.com>
+Hank John <jindongh at gmail.com>
+haridsv
 Hong Minhee <minhee at dahlia.kr>
 Ian Eure <ian.eure at gmail.com>
 Ian Struble <istruble at gmail.com>
 Ionel Maries Cristian <contact at ionelmc.ro>
+iSlava <sig.crea at gmail.com>
 James Saryerwinnie <js at jamesls.com>
 James Turk <james.p.turk at gmail.com>
 Jason Cater <jason at ncsfulfillment.com>
@@ -66,6 +69,8 @@ John Spray <jcspray at gmail.com>
 John Watson <john at disqus.com>
 Jonathan Halcrow <jonathan.halcrow at gmail.com>
 Joseph Crosland <jcrosland at flumotion.com>
+Joshua Harlow <harlowja at gmail.com>
+Kai Groner <kai at gronr.com>
 Keith Fitzgerald <ghostrocket at me.com>
 Kevin McCarthy <me at kevinmccarthy.org>
 Kevin McDonald <k3vinmcdonald at gmail.com>
@@ -74,8 +79,10 @@ Len Buckens <buckens.len at gmail.com>
 Mahendra M <Mahendra_M at infosys.com>
 Marcin Lulek (ergo) <info at webreactor.eu>
 Mark Lavin <mlavin at caktusgroup.com>
+markow <markow at red-sky.pl>
 Matt Wise <wise at wiredgeek.net>
 Maxime Rouyrre <rouyrre+git at gmail.com>
+mdk <luc.mdk at gmail.com>
 Mher Movsisyan <mher.movsisyan at gmail.com>
 Michael Barrett <mb at eventbrite.com>
 Michael Nelson <michaeln at telesign.com>
@@ -123,6 +130,3 @@ Vince Gonzalez <vince.gonzalez at gmail.com>
 Vincent Driessen <vincent at datafox.nl>
 Zach Smith <zmsmith27 at gmail.com>
 Zhao Xiaohong <mrluanma at gmail.com>
-haridsv
-iSlava <sig.crea at gmail.com>
-markow <markow at red-sky.pl>
diff --git a/Changelog b/Changelog
index e31b733..36006c1 100644
--- a/Changelog
+++ b/Changelog
@@ -4,6 +4,34 @@
  Change history
 ================
 
+.. _version-3.0.30:
+
+3.0.30
+======
+:release-date: 2015-12-07 12:28 A.M PDT
+:release-by: Ask Solem
+
+- Fixes compatiblity with uuid in Python 2.7.11 and 3.5.1.
+
+    Fix contributed by Kai Groner.
+
+- Redis transport: Attempt at fixing problem with hanging consumer
+  after disconnected from server.
+
+- Event loop:
+    Attempt at fixing issue with 100% CPU when using the Redis transport,
+
+- Database transport: Fixed oracle compatiblity.
+
+    An "ORA-00907: missing right parenthesis" error could manifest when using
+    an Oracle database with the database transport.
+
+    Fix contributed by Deepak N.
+
+- Documentation fixes
+
+    Contributed by Tommaso Barbugli.
+
 .. _version-3.0.29:
 
 3.0.29
diff --git a/PKG-INFO b/PKG-INFO
index 4371b75..0e012ea 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: kombu
-Version: 3.0.29
+Version: 3.0.30
 Summary: Messaging library for Python
 Home-page: http://kombu.readthedocs.org
 Author: Ask Solem
@@ -12,7 +12,7 @@ Description: .. _kombu-index:
          kombu - Messaging library for Python
         ========================================
         
-        :Version: 3.0.29
+        :Version: 3.0.30
         
         `Kombu` is a messaging library for Python.
         
diff --git a/README.rst b/README.rst
index 7474d2a..3371801 100644
--- a/README.rst
+++ b/README.rst
@@ -4,7 +4,7 @@
  kombu - Messaging library for Python
 ========================================
 
-:Version: 3.0.29
+:Version: 3.0.30
 
 `Kombu` is a messaging library for Python.
 
diff --git a/docs/changelog.rst b/docs/changelog.rst
index e31b733..36006c1 100644
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -4,6 +4,34 @@
  Change history
 ================
 
+.. _version-3.0.30:
+
+3.0.30
+======
+:release-date: 2015-12-07 12:28 A.M PDT
+:release-by: Ask Solem
+
+- Fixes compatiblity with uuid in Python 2.7.11 and 3.5.1.
+
+    Fix contributed by Kai Groner.
+
+- Redis transport: Attempt at fixing problem with hanging consumer
+  after disconnected from server.
+
+- Event loop:
+    Attempt at fixing issue with 100% CPU when using the Redis transport,
+
+- Database transport: Fixed oracle compatiblity.
+
+    An "ORA-00907: missing right parenthesis" error could manifest when using
+    an Oracle database with the database transport.
+
+    Fix contributed by Deepak N.
+
+- Documentation fixes
+
+    Contributed by Tommaso Barbugli.
+
 .. _version-3.0.29:
 
 3.0.29
diff --git a/docs/introduction.rst b/docs/introduction.rst
index 7474d2a..3371801 100644
--- a/docs/introduction.rst
+++ b/docs/introduction.rst
@@ -4,7 +4,7 @@
  kombu - Messaging library for Python
 ========================================
 
-:Version: 3.0.29
+:Version: 3.0.30
 
 `Kombu` is a messaging library for Python.
 
diff --git a/docs/userguide/pools.rst b/docs/userguide/pools.rst
index 6db3713..1cdf36e 100644
--- a/docs/userguide/pools.rst
+++ b/docs/userguide/pools.rst
@@ -155,7 +155,7 @@ instances:
     from kombu import pools
     from kombu import Connection
 
-    connections = pools.Connection(limit=100)
+    connections = pools.Connections(limit=100)
     producers = pools.Producers(limit=connections.limit)
 
     connection = Connection('amqp://guest:guest@localhost:5672//')
diff --git a/docs/userguide/serialization.rst b/docs/userguide/serialization.rst
index b85fed7..433879e 100644
--- a/docs/userguide/serialization.rst
+++ b/docs/userguide/serialization.rst
@@ -106,10 +106,10 @@ Sending raw data without Serialization
 ======================================
 
 In some cases, you don't need your message data to be serialized. If you
-pass in a plain string or Unicode object as your message, then `Kombu` will
+pass in a plain string or Unicode object as your message and a custom `content_type`, then `Kombu` will
 not waste cycles serializing/deserializing the data.
 
-You can optionally specify a `content_type` and `content_encoding`
+You can optionally specify a `content_encoding`
 for the raw data::
 
     >>> with open("~/my_picture.jpg", "rb") as fh:
diff --git a/extra/appveyor/install.ps1 b/extra/appveyor/install.ps1
new file mode 100644
index 0000000..3f05628
--- /dev/null
+++ b/extra/appveyor/install.ps1
@@ -0,0 +1,85 @@
+# Sample script to install Python and pip under Windows
+# Authors: Olivier Grisel and Kyle Kastner
+# License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/
+
+$BASE_URL = "https://www.python.org/ftp/python/"
+$GET_PIP_URL = "https://bootstrap.pypa.io/get-pip.py"
+$GET_PIP_PATH = "C:\get-pip.py"
+
+
+function DownloadPython ($python_version, $platform_suffix) {
+    $webclient = New-Object System.Net.WebClient
+    $filename = "python-" + $python_version + $platform_suffix + ".msi"
+    $url = $BASE_URL + $python_version + "/" + $filename
+
+    $basedir = $pwd.Path + "\"
+    $filepath = $basedir + $filename
+    if (Test-Path $filename) {
+        Write-Host "Reusing" $filepath
+        return $filepath
+    }
+
+    # Download and retry up to 5 times in case of network transient errors.
+    Write-Host "Downloading" $filename "from" $url
+    $retry_attempts = 3
+    for($i=0; $i -lt $retry_attempts; $i++){
+        try {
+            $webclient.DownloadFile($url, $filepath)
+            break
+        }
+        Catch [Exception]{
+            Start-Sleep 1
+        }
+   }
+   Write-Host "File saved at" $filepath
+   return $filepath
+}
+
+
+function InstallPython ($python_version, $architecture, $python_home) {
+    Write-Host "Installing Python" $python_version "for" $architecture "bit architecture to" $python_home
+    if (Test-Path $python_home) {
+        Write-Host $python_home "already exists, skipping."
+        return $false
+    }
+    if ($architecture -eq "32") {
+        $platform_suffix = ""
+    } else {
+        $platform_suffix = ".amd64"
+    }
+    $filepath = DownloadPython $python_version $platform_suffix
+    Write-Host "Installing" $filepath "to" $python_home
+    $args = "/qn /i $filepath TARGETDIR=$python_home"
+    Write-Host "msiexec.exe" $args
+    Start-Process -FilePath "msiexec.exe" -ArgumentList $args -Wait -Passthru
+    Write-Host "Python $python_version ($architecture) installation complete"
+    return $true
+}
+
+
+function InstallPip ($python_home) {
+    $pip_path = $python_home + "/Scripts/pip.exe"
+    $python_path = $python_home + "/python.exe"
+    if (-not(Test-Path $pip_path)) {
+        Write-Host "Installing pip..."
+        $webclient = New-Object System.Net.WebClient
+        $webclient.DownloadFile($GET_PIP_URL, $GET_PIP_PATH)
+        Write-Host "Executing:" $python_path $GET_PIP_PATH
+        Start-Process -FilePath "$python_path" -ArgumentList "$GET_PIP_PATH" -Wait -Passthru
+    } else {
+        Write-Host "pip already installed."
+    }
+}
+
+function InstallPackage ($python_home, $pkg) {
+    $pip_path = $python_home + "/Scripts/pip.exe"
+    & $pip_path install $pkg
+}
+
+function main () {
+    InstallPython $env:PYTHON_VERSION $env:PYTHON_ARCH $env:PYTHON
+    InstallPip $env:PYTHON
+    InstallPackage $env:PYTHON wheel
+}
+
+main
diff --git a/extra/appveyor/run_with_compiler.cmd b/extra/appveyor/run_with_compiler.cmd
new file mode 100644
index 0000000..3a472bc
--- /dev/null
+++ b/extra/appveyor/run_with_compiler.cmd
@@ -0,0 +1,47 @@
+:: To build extensions for 64 bit Python 3, we need to configure environment
+:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
+:: MS Windows SDK for Windows 7 and .NET Framework 4 (SDK v7.1)
+::
+:: To build extensions for 64 bit Python 2, we need to configure environment
+:: variables to use the MSVC 2008 C++ compilers from GRMSDKX_EN_DVD.iso of:
+:: MS Windows SDK for Windows 7 and .NET Framework 3.5 (SDK v7.0)
+::
+:: 32 bit builds do not require specific environment configurations.
+::
+:: Note: this script needs to be run with the /E:ON and /V:ON flags for the
+:: cmd interpreter, at least for (SDK v7.0)
+::
+:: More details at:
+:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows
+:: http://stackoverflow.com/a/13751649/163740
+::
+:: Author: Olivier Grisel
+:: License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/
+ at ECHO OFF
+
+SET COMMAND_TO_RUN=%*
+SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows
+
+SET MAJOR_PYTHON_VERSION="%PYTHON_VERSION:~0,1%"
+IF %MAJOR_PYTHON_VERSION% == "2" (
+    SET WINDOWS_SDK_VERSION="v7.0"
+) ELSE IF %MAJOR_PYTHON_VERSION% == "3" (
+    SET WINDOWS_SDK_VERSION="v7.1"
+) ELSE (
+    ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%"
+    EXIT 1
+)
+
+IF "%PYTHON_ARCH%"=="64" (
+    ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION% on a 64 bit architecture
+    SET DISTUTILS_USE_SDK=1
+    SET MSSdk=1
+    "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION%
+    "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release
+    ECHO Executing: %COMMAND_TO_RUN%
+    call %COMMAND_TO_RUN% || EXIT 1
+) ELSE (
+    ECHO Using default MSVC build environment for 32 bit architecture
+    ECHO Executing: %COMMAND_TO_RUN%
+    call %COMMAND_TO_RUN% || EXIT 1
+)
diff --git a/kombu.egg-info/PKG-INFO b/kombu.egg-info/PKG-INFO
index 4371b75..0e012ea 100644
--- a/kombu.egg-info/PKG-INFO
+++ b/kombu.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: kombu
-Version: 3.0.29
+Version: 3.0.30
 Summary: Messaging library for Python
 Home-page: http://kombu.readthedocs.org
 Author: Ask Solem
@@ -12,7 +12,7 @@ Description: .. _kombu-index:
          kombu - Messaging library for Python
         ========================================
         
-        :Version: 3.0.29
+        :Version: 3.0.30
         
         `Kombu` is a messaging library for Python.
         
diff --git a/kombu.egg-info/SOURCES.txt b/kombu.egg-info/SOURCES.txt
index 48fcd61..aed5208 100644
--- a/kombu.egg-info/SOURCES.txt
+++ b/kombu.egg-info/SOURCES.txt
@@ -107,6 +107,8 @@ examples/simple_task_queue/queues.py
 examples/simple_task_queue/tasks.py
 examples/simple_task_queue/worker.py
 extra/doc2ghpages
+extra/appveyor/install.ps1
+extra/appveyor/run_with_compiler.cmd
 extra/release/bump_version.py
 extra/release/doc4allmods
 extra/release/flakeplus.py
diff --git a/kombu/__init__.py b/kombu/__init__.py
index c7326df..3e54569 100644
--- a/kombu/__init__.py
+++ b/kombu/__init__.py
@@ -11,7 +11,7 @@ version_info_t = namedtuple(
     'version_info_t', ('major', 'minor', 'micro', 'releaselevel', 'serial'),
 )
 
-VERSION = version_info_t(3, 0, 29, '', '')
+VERSION = version_info_t(3, 0, 30, '', '')
 __version__ = '{0.major}.{0.minor}.{0.micro}{0.releaselevel}'.format(VERSION)
 __author__ = 'Ask Solem'
 __contact__ = 'ask at celeryproject.org'
diff --git a/kombu/async/hub.py b/kombu/async/hub.py
index 6c632fd..551f351 100644
--- a/kombu/async/hub.py
+++ b/kombu/async/hub.py
@@ -30,6 +30,14 @@ logger = get_logger(__name__)
 
 _current_loop = None
 
+W_UNKNOWN_EVENT = """\
+Received unknown event %r for fd %r, please contact support!\
+"""
+
+W_EVENT_UNREGISTERED = """\
+Deregistered fd %r from event loop without registered callbacks.\
+"""
+
 
 class Stop(BaseException):
     """Stops the event loop."""
@@ -146,12 +154,18 @@ class Hub(object):
                     logger.error('Error in timer: %r', exc, exc_info=1)
         return min(delay or min_delay, max_delay)
 
+    def _remove_from_loop(self, fd):
+        try:
+            self._unregister(fd)
+        finally:
+            self._discard(fd)
+
     def add(self, fd, callback, flags, args=(), consolidate=False):
         fd = fileno(fd)
         try:
             self.poller.register(fd, flags)
         except ValueError:
-            self._discard(fd)
+            self._remove_from_loop(fd)
             raise
         else:
             dest = self.readers if flags & READ else self.writers
@@ -163,8 +177,7 @@ class Hub(object):
 
     def remove(self, fd):
         fd = fileno(fd)
-        self._unregister(fd)
-        self._discard(fd)
+        self._remove_from_loop(fd)
 
     def run_forever(self):
         self._running = True
@@ -207,8 +220,7 @@ class Hub(object):
         writable = fd in self.writers
         on_write = self.writers.get(fd)
         try:
-            self._unregister(fd)
-            self._discard(fd)
+            self._remove_from_loop(fd)
         finally:
             if writable:
                 cb, args = on_write
@@ -218,8 +230,7 @@ class Hub(object):
         readable = fd in self.readers
         on_read = self.readers.get(fd)
         try:
-            self._unregister(fd)
-            self._discard(fd)
+            self._remove_from_loop(fd)
         finally:
             if readable:
                 cb, args = on_read
@@ -280,6 +291,7 @@ class Hub(object):
                     raise StopIteration()
 
                 for fd, event in events or ():
+                    general_error = False
                     if fd in consolidate and \
                             writers.get(fd) is None:
                         to_consolidate.append(fd)
@@ -299,6 +311,12 @@ class Hub(object):
                             self.remove_writer(fd)
                             continue
                     elif event & ERR:
+                        general_error = True
+                    else:
+                        logger.info(W_UNKNOWN_EVENT, event, fd)
+                        general_error = True
+
+                    if general_error:
                         try:
                             cb, cbargs = (readers.get(fd) or
                                           writers.get(fd))
@@ -306,7 +324,10 @@ class Hub(object):
                             pass
 
                     if cb is None:
+                        logger.info(W_EVENT_UNREGISTERED, fd)
+                        self.remove(fd)
                         continue
+
                     if isinstance(cb, generator):
                         try:
                             next(cb)
diff --git a/kombu/transport/django/managers.py b/kombu/transport/django/managers.py
index b362468..d33d290 100644
--- a/kombu/transport/django/managers.py
+++ b/kombu/transport/django/managers.py
@@ -52,6 +52,8 @@ class QueueManager(models.Manager):
 
 
 def select_for_update(qs):
+    if connection.vendor == 'oracle':
+        return qs
     try:
         return qs.select_for_update()
     except AttributeError:
diff --git a/kombu/transport/qpid.py b/kombu/transport/qpid.py
index 2fd5cdf..a5a0d12 100644
--- a/kombu/transport/qpid.py
+++ b/kombu/transport/qpid.py
@@ -79,7 +79,6 @@ Celery with Kombu, this can be accomplished by setting the
 """
 from __future__ import absolute_import
 
-import fcntl
 import os
 import select
 import socket
@@ -94,6 +93,11 @@ from gettext import gettext as _
 import amqp.protocol
 
 try:
+    import fcntl
+except ImportError:
+    fcntl = None  # noqa
+
+try:
     import qpidtoollibs
 except ImportError:  # pragma: no cover
     qpidtoollibs = None     # noqa
@@ -1479,7 +1483,8 @@ class Transport(base.Transport):
         self.verify_runtime_environment()
         super(Transport, self).__init__(*args, **kwargs)
         self.r, self._w = os.pipe()
-        fcntl.fcntl(self.r, fcntl.F_SETFL, os.O_NONBLOCK)
+        if fcntl is not None:
+            fcntl.fcntl(self.r, fcntl.F_SETFL, os.O_NONBLOCK)
 
     def verify_runtime_environment(self):
         """Verify that the runtime environment is acceptable.
diff --git a/kombu/transport/redis.py b/kombu/transport/redis.py
index 5a3ad30..35e1ca9 100644
--- a/kombu/transport/redis.py
+++ b/kombu/transport/redis.py
@@ -97,6 +97,11 @@ def get_redis_error_classes():
     )
 
 
+def get_redis_ConnectionError():
+    from redis import exceptions
+    return exceptions.ConnectionError
+
+
 class MutexHeld(Exception):
     pass
 
@@ -373,6 +378,7 @@ class Channel(virtual.Channel):
 
     _client = None
     _subclient = None
+    _closing = False
     supports_fanout = True
     keyprefix_queue = '_kombu.binding.%s'
     keyprefix_fanout = '/{db}.'
@@ -462,8 +468,12 @@ class Channel(virtual.Channel):
             self._pool.disconnect()
 
     def _on_connection_disconnect(self, connection):
+        self._in_poll = False
+        self._in_listen = False
         if self.connection and self.connection.cycle:
             self.connection.cycle._on_connection_disconnect(connection)
+        if not self._closing:
+            raise get_redis_ConnectionError()
 
     def _do_restore_message(self, payload, exchange, routing_key,
                             client=None, leftmost=False):
@@ -738,6 +748,7 @@ class Channel(virtual.Channel):
                 return sum(sizes[::2])
 
     def close(self):
+        self._closing = True
         if self._pool:
             self._pool.disconnect()
         if not self.closed:
diff --git a/kombu/utils/__init__.py b/kombu/utils/__init__.py
index 0745ddf..76779b0 100644
--- a/kombu/utils/__init__.py
+++ b/kombu/utils/__init__.py
@@ -16,7 +16,11 @@ from contextlib import contextmanager
 from itertools import count, repeat
 from functools import wraps
 from time import sleep
-from uuid import UUID, uuid4 as _uuid4, _uuid_generate_random
+from uuid import UUID, uuid4
+try:
+    from uuid import _uuid_generate_random
+except ImportError:
+    _uuid_generate_random = None
 
 from kombu.five import items, reraise, string_t
 
@@ -140,13 +144,12 @@ def say(m, *fargs, **fkwargs):
     print(str(m).format(*fargs, **fkwargs), file=sys.stderr)
 
 
-def uuid4():
-    # Workaround for http://bugs.python.org/issue4607
-    if ctypes and _uuid_generate_random:  # pragma: no cover
+if ctypes and _uuid_generate_random:  # pragma: no cover
+    def uuid4():
+        # Workaround for http://bugs.python.org/issue4607
         buffer = ctypes.create_string_buffer(16)
         _uuid_generate_random(buffer)
         return UUID(bytes=buffer.raw)
-    return _uuid4()
 
 
 def uuid():

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



More information about the Python-modules-commits mailing list