Bug#568512: python-brlapi: ConnectionError is invalidly specified
Package: python-brlapi
Version: 4.1-4
Severity: important
Description of the problem:
>ipython
In [1]:import brlapi
In [2]:b=brlapi.Connection()
---------------------------------------------------------------------------
ConnectionError Traceback (most recent call last)
/home/oaubert/src/advene/<ipython console> in <module>()
/usr/lib/pymodules/python2.5/brlapi.so in brlapi.Connection.__init__()
<type 'str'>: (<type 'exceptions.AttributeError'>, AttributeError("'ConnectionError' object has no attribute 'exception'",))
Analysis: ConnectionError inherits from OperationError. OperationError.__init__ is rightly called from ConnectionError.__init__. In OperationError.__init__, if c_brlapi.brlapi_protocolException() returns null, no self.exception attribute is defined, but it is checked against in __str__ (which is implicitly called when displaying the exception).
Proposed patch-idea:
modify the self.exception check in __str__ this way:
if hasattr(self, 'exception'):
return self.exception
-- System Information:
Debian Release: squeeze/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.32-trunk-686 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash
Versions of packages python-brlapi depends on:
ii libbrlapi0.5 4.1-4 braille display access via BRLTTY
ii libc6 2.10.2-2 GNU C Library: Shared libraries
ii python 2.5.4-9 An interactive high-level object-o
ii python-support 1.0.6 automated rebuilding support for P
python-brlapi recommends no packages.
python-brlapi suggests no packages.
-- no debconf information
Reply to: