Bug#743410: python-pika: NameError Exception in python-pika

2014-04-02 Thread Robin Wittler
Package: python-pika
Version: 0.9.5-1
Severity: normal

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


Hello,

when you execute this code ...

#!/usr/bin/env python

import pika
from itertools import count

counter = count(1)

def receive_callback(channel, method, properties, body):
print 'Received message {counter}: {body}'.format(
counter=counter.next(),
body=body
)

channel.basic_ack(delivery_tag=method.delivery_tag)


connection = pika.BlockingConnection(
pika.ConnectionParameters(
host='127.0.0.1',
port=5672,
)
)

channel = connection.channel()

channel.queue_declare(queue='testertest', durable=True)
channel.basic_qos(prefetch_count=1)
channel.basic_consume(
receive_callback,
queue='testertest'
)

print 'Waiting for messages ...'
channel.start_consuming()


you will get this Exception after N seconds (where N is defined at 
SOCKET_TIMEOUT_THRESHOLD in pika/adapters/blocking_connection.py (default is 
100))


Waiting for messages ...
Traceback (most recent call last):
  File 
/usr/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py, line 
293, in start_consuming
self.transport.connection.process_data_events()
  File 
/usr/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py, line 
103, in process_data_events
self.process_timeouts()
  File 
/usr/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py, line 
157, in process_timeouts
log.debug('%s: Timeout calling %s',
NameError: global name 'log' is not defined


This Exception makes it impossible for the process_timeouts method to
handle timeouts. Code, which uses BlockingConnection, will fail
in a unexpected way.

I attached a patch to fix this problem.

Cheers,
Robin


- -- System Information:
Debian Release: 7.4
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages python-pika depends on:
ii  python 2.7.3-4+deb7u1
ii  python2.6  2.6.8-1.1
ii  python2.7  2.7.3-6

python-pika recommends no packages.

python-pika suggests no packages.

- -- no debconf information

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBAgAGBQJTPAHZAAoJEKkIkdarOw7WeikP/0E62/sNUOfD/GF7MCD+RydS
uHCINmKMEmWZGD6Qe9ygAcASophh1UrWUgrrIia75SR1I/5Cl3dd3khRpo0PFxZc
Fkhd3JOCJxJueziWLtWghAVSw/cSZrr67y/6Bh3h4EZSJrnyPYcYDfNNswEecBvj
U+ZM1/7o5DuQjzV8oyiopQX+69TpgbnVf+1dcKy4UGEH7wubO3+0n4kGF/X0xNO7
k+VsWVF0hPP951Pmr1i+tZdX/WkgkISOgFEdXyCLZ7Dvpq5lpPpjSqKuxnHTlIW4
gvLznjrKLNNZMmiLdp/aKmaemkJrtoa6oAF4/j24nmaFBWTTVzmzYEhAu1qKx/71
hMcVzB8nt9PWKr/pRtfyEah9rWg0n/EErPV4X7ZGTlYe6LqIKdF1IyEFMVm8HyXn
0YKLuwm4/AbPpBQ5PsECmxHRCX2nnDH0kmya+w6r2+SIsW8Bgo6uY24n2eeziLn4
2NsEuI+tU4DknZdTiVXBJpaom+Mcc2ZW02VtGz8JLK8pKkJsksdNTVJmQBVt4dZl
WO81UH1RMjzRUmx41uLULENKlN9THR8ZiRGS6DRYpywDwZWlWIXa+sc6e6wv3WX2
OTEr/X4s6aRTXrBgxeEt4cETbCGh7JVleIwBjzg5MPee2xDeX3hbhTQzvoxEaRRs
KDEXT1BrEDWZEkxPkHvk
=oht0
-END PGP SIGNATURE-
--- a/pika/adapters/blocking_connection.py
+++ b/pika/adapters/blocking_connection.py
@@ -8,6 +8,7 @@
 import time
 import types
 
+import pika.log
 import pika.spec as spec
 
 from pika.adapters import BaseConnection
@@ -78,7 +79,7 @@
 except socket.timeout:
 self._socket_timeouts += 1
 if self._socket_timeouts  SOCKET_TIMEOUT_THRESHOLD:
-log.error(SOCKET_TIMEOUT_MESSAGE)
+pika.log.error(SOCKET_TIMEOUT_MESSAGE)
 self._handle_disconnect()
 
 def process_data_events(self):
@@ -96,7 +97,7 @@
 except socket.timeout:
 self._socket_timeouts += 1
 if self._socket_timeouts  SOCKET_TIMEOUT_THRESHOLD:
-log.error(SOCKET_TIMEOUT_MESSAGE)
+pika.log.error(SOCKET_TIMEOUT_MESSAGE)
 self._handle_disconnect()
 
 # Process our timeout events
@@ -154,7 +155,7 @@
 for timeout_id in keys:
 if timeout_id in self._timeouts and \
 self._timeouts[timeout_id]['deadline'] = start_time:
-log.debug('%s: Timeout calling %s',
+pika.log.debug('%s: Timeout calling %s',
   self.__class__.__name__,
   self._timeouts[timeout_id]['handler'])
 self._timeouts[timeout_id]['handler']()


Bug#651687: python-ldap: new upstream version available

2011-12-12 Thread Robin Wittler
Hi,

here is a patch for building python-ldap 2.4.6 with the python-ldap
2.3.13-1 debian files, and a newer control file (which only append
python-pyasn1 to the depends - which is needed for ldap.syncrepl).

I hope this could be some help.

Cheers,
Robin

Index: python-ldap-2.4.6/setup.cfg
===
--- python-ldap-2.4.6.orig/setup.cfg	2011-11-27 16:28:04.0 +0100
+++ python-ldap-2.4.6/setup.cfg	2011-12-12 19:50:35.905919623 +0100
@@ -1,10 +1,10 @@
 [_ldap]
-library_dirs = /opt/openldap-RE24/lib
-include_dirs = /opt/openldap-RE24/include /usr/include/sasl
+library_dirs =
+include_dirs = /usr/include/sasl
 defines = HAVE_SASL HAVE_TLS
 extra_compile_args = -g
 extra_objects = 
-libs = ldap_r
+libs = ldap_r lber sasl2
 
 [install]
 compile = 1
Source: python-ldap
Section: python
Priority: optional
Maintainer: Matej Vela v...@debian.org
Standards-Version: 3.9.2
Build-Depends: debhelper (= 8), python-all-dev (= 2.6.6-3~), python-all-dbg, 
libldap2-dev, libsasl2-dev
Homepage: http://www.python-ldap.org/
X-Python-Version: = 2.3

Package: python-ldap
Architecture: any
Depends: ${python:Depends}, ${misc:Depends}, ${shlibs:Depends}, python-pyasn1
Breaks: ${python:Breaks}
Provides: ${python:Provides}
Suggests: python-ldap-doc
Conflicts: python2.3-ldap ( 2.2.0-1.1), python2.4-ldap ( 2.2.0-1.1), 
python2.3-ldap-tls
Replaces: python2.3-ldap ( 2.2.0-1.1), python2.4-ldap ( 2.2.0-1.1), 
python2.3-ldap-tls
Description: LDAP interface module for Python
 This module provides a Python interface to the OpenLDAP client library
 (LDAP is the Lightweight Directory Access Protocol).

Package: python-ldap-dbg
Section: debug
Priority: extra
Architecture: any
Depends: python-ldap (= ${binary:Version}), python-dbg, ${python:Depends}, 
${misc:Depends}, ${shlibs:Depends}
Breaks: ${python:Breaks}
Provides: ${python:Provides}
Description: LDAP interface module for Python (debug extension)
 This module provides a Python interface to the OpenLDAP client library
 (LDAP is the Lightweight Directory Access Protocol).
 .
 This package contains the extension built for the Python debug interpreter.


Bug#432007: version crap

2007-10-05 Thread Robin Wittler
Hi,

i think there is something wrong with your version.
Take a look at this:


# LC_ALL=C apt-get -s install ktorrent=2.0.3+dfsg1-2etch1
Reading package lists... Done
Building dependency tree... Done
The following packages will be DOWNGRADED:
  ktorrent
0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.
Inst ktorrent [2.0.3+dfsg1-2.2] (2.0.3+dfsg1-2etch1 Debian-Security:stable)
Conf ktorrent (2.0.3+dfsg1-2etch1 Debian-Security:stable)


# LC_ALL=C apt-get -s install ktorrent=2.0.3+dfsg1-2.2
Reading package lists... Done
Building dependency tree... Done
ktorrent is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.


# LC_ALL=C apt-get -s upgrade
Reading package lists... Done
Building dependency tree... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

-

The ktorrent=2.0.3+dfsg1-2.2 is the actual version on this system. it
will never update this version: 2.0.3+dfsg1-2etch1

So what went wrong? *g*


Greetings,
Robin Wittler



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]