[hplip/f13/master] Fixed traceback on error condition in device.py (bug #628125).

Tim Waugh twaugh at fedoraproject.org
Mon Oct 18 16:37:26 UTC 2010


commit 39b6ecf5b378531520fddbc2978b1a5d59956471
Author: Tim Waugh <twaugh at redhat.com>
Date:   Mon Oct 18 17:31:24 2010 +0100

    Fixed traceback on error condition in device.py (bug #628125).

 hplip-raw_deviceID-traceback.patch |   24 ++++++++++++++++++++++++
 hplip.spec                         |    5 +++++
 2 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/hplip-raw_deviceID-traceback.patch b/hplip-raw_deviceID-traceback.patch
new file mode 100644
index 0000000..062c331
--- /dev/null
+++ b/hplip-raw_deviceID-traceback.patch
@@ -0,0 +1,24 @@
+diff -up hplip-3.10.9/base/device.py.raw_deviceID-traceback hplip-3.10.9/base/device.py
+--- hplip-3.10.9/base/device.py.raw_deviceID-traceback	2010-10-18 17:22:55.138868192 +0100
++++ hplip-3.10.9/base/device.py	2010-10-18 17:24:02.965869220 +0100
+@@ -1368,6 +1368,8 @@ class Device(object):
+ 
+     def getDeviceID(self):
+         needs_close = False
++        self.raw_deviceID = ''
++        self.deviceID = {}
+         if self.io_state != IO_STATE_HP_OPEN:
+            try:
+                self.open()
+@@ -1377,10 +1379,7 @@ class Device(object):
+ 
+         result_code, data = hpmudext.get_device_id(self.device_id)
+ 
+-        if result_code != hpmudext.HPMUD_R_OK:
+-            self.raw_deviceID = ''
+-            self.deviceID = {}
+-        else:
++        if result_code == hpmudext.HPMUD_R_OK:
+             self.raw_deviceID = data
+             self.deviceID = parseDeviceID(data)
+ 
diff --git a/hplip.spec b/hplip.spec
index d998fc9..d3c46c8 100644
--- a/hplip.spec
+++ b/hplip.spec
@@ -38,6 +38,7 @@ Patch21: hplip-openPPD.patch
 Patch22: hplip-ppd-ImageableArea.patch
 Patch23: hplip-network-timeout.patch
 Patch24: hplip-addgroup.patch
+Patch25: hplip-raw_deviceID-traceback.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
@@ -238,6 +239,9 @@ done
 # utils.addgroup() was returning string instead of array (bug #642771).
 %patch24 -p1 -b .addgroup
 
+# Fixed traceback on error condition in device.py (bug #628125).
+%patch25 -p1 -b .raw_deviceID-traceback
+
 sed -i.duplex-constraints \
     -e 's,\(UIConstraints.* \*Duplex\),//\1,' \
     prnt/drv/hpcups.drv.in
@@ -465,6 +469,7 @@ fi
 
 %changelog
 * Mon Oct 18 2010 Tim Waugh <twaugh at redhat.com> - 3.10.9-3
+- Fixed traceback on error condition in device.py (bug #628125).
 - Fixed bogus low ink warnings from hpijs driver (bug #643643).
 
 * Thu Oct 14 2010 Jiri Popelka <jpopelka at redhat.com> - 3.10.9-2


More information about the scm-commits mailing list