Bug#624103: system-config-printer: Verifing samba printer access causes pysmb import
Vsevolod Krishchenko
mstu at sevik.ru
Mon Apr 25 14:39:21 UTC 2011
Package: system-config-printer
Version: 1.2.3-3
Severity: important
Tags: patch
Select smb printer, select 'properties', 'Change' after 'Make and Model'.
Then select 'Windows printer via SAMBA', put printer URI after 'smb://'.
Select verify. Thr stderror shows the following run-time error:
$ system-config-printer
....
Caught non-fatal exception. Traceback:
File "/usr/bin/system-config-printer", line 5546, in on_btnSMBVerify_clicked
smbc_auth = pysmb.AuthContext (self.NewPrinterWindow,
NameError: global name 'pysmb' is not defined
Continuing anyway..
(and we'll see some strange error message in GUI even if printer is ok).
File pysmb.py is included in system-config-printer package.
Still, was it imported too late in this case.
Using pysmb before import causes this run-time error.
Possible patch is following.
==================
diff --git a/usr/bin/system-config-printer b/usr/bin/system-config-printer
index 9148b88..3bf3c0b 100755
--- a/usr/bin/system-config-printer
+++ b/usr/bin/system-config-printer
@@ -23,6 +23,9 @@
import sys
sys.path.append("/usr/share/system-config-printer")
+import pysmb
+PYSMB_AVAILABLE=True
+
# config is generated from config.py.in by configure
import config
@@ -77,11 +80,11 @@ import cups
cups.require ("1.9.46")
cups.ppdSetConformance (cups.PPD_CONFORM_RELAXED)
-try:
- import pysmb
- PYSMB_AVAILABLE=True
-except:
- PYSMB_AVAILABLE=False
+#try:
+# import pysmb
+# PYSMB_AVAILABLE=True
+#except:
+## PYSMB_AVAILABLE=False
import cupshelpers, options
import gobject # for TYPE_STRING and TYPE_PYOBJECT
==================
-- System Information:
Debian Release: 6.0.1
APT prefers stable
APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.32-5-amd64 (SMP w/2 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 system-config-printer depends on:
ii gnome-icon-theme 2.30.3-2 GNOME Desktop icon theme
ii python 2.6.6-3+squeeze6 interactive high-level object-orie
ii python-cups 1.9.48-1 Python bindings for CUPS
ii python-cupshelpers 1.2.3-3 Python utility modules around the
ii python-dbus 0.83.1-1 simple interprocess messaging syst
ii python-glade2 2.17.0-4 GTK+ bindings: Glade support
ii python-gnome2 2.28.1-1 Python bindings for the GNOME desk
ii python-gtk2 2.17.0-4 Python bindings for the GTK+ widge
ii python-libxml2 2.7.8.dfsg-2 Python bindings for the GNOME XML
ii python-notify 0.1.1-2+b2 Python bindings for libnotify
ii python-support 1.0.10 automated rebuilding support for P
Versions of packages system-config-printer recommends:
ii cups-pk-helper 0.1.0-2 PolicyKit helper to configure cups
ii system-config-printer-udev 1.2.3-3 Utilities to detect and configure
Versions of packages system-config-printer suggests:
pn python-gnomekeyring <none> (no description available)
ii python-smbc 1.0.6-1 Python bindings for the Samba clie
pn sessioninstaller <none> (no description available)
-- debconf-show failed
More information about the pkg-gnome-maintainers
mailing list