Bug 194433 - [patch]printconf: browse_smb_hosts: local variable 'iter' referenced before assignment
[patch]printconf: browse_smb_hosts: local variable 'iter' referenced before a...
Product: Fedora
Classification: Fedora
Component: system-config-printer (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
: Reopened
Depends On:
  Show dependency treegraph
Reported: 2006-06-07 23:35 EDT by Scott Tsai
Modified: 2008-03-12 01:57 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-03-12 01:57:01 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Assign "iter" to None before the loop, check it afterwards. (949 bytes, patch)
2006-06-07 23:35 EDT, Scott Tsai
no flags Details | Diff

  None (edit)
Description Scott Tsai 2006-06-07 23:35:36 EDT
Description of problem:
When trying to browse for smb printers, 
/usr/share/printconf/util/addQueue.py prints out a python exception.

Version-Release number of selected component (if applicable):

How reproducible:
This will trigger when pysmb.get_domain_list() returns an empty dictionary.

Steps to Reproduce:
1. system-config-printer
2. "Action" -> "New Queue" -> queue type: "SMB"
Actual results:
prints out:
Traceback (most recent call last):
  File "/usr/share/printconf/util/addQueue.py", line 524, in type_menu_changed
    self.browse_smb_hosts ()
  File "/usr/share/printconf/util/addQueue.py", line 869, in browse_smb_hosts
    dummy = store.append (iter)
UnboundLocalError: local variable 'iter' referenced before assignment

on terminal.

Expected results:
No python programming errors.

Additional info:
Will attach a simple patch to fix this.

The util/addQueue.py file mixes Tabs and Spaces for indentation.
This can cause real bugs in the Python programming language.
Would you consider configuring your editor differently?

Does "printconf" have an upstream CVS or mailing list where I can help fix this
kind of bugs?
Comment 1 Scott Tsai 2006-06-07 23:35:36 EDT
Created attachment 130721 [details]
Assign "iter" to None before the loop, check it afterwards.
Comment 2 Tim Waugh 2006-06-20 09:26:41 EDT
Fixed in CVS.  Future FC5 updates should contain the fix.

FWIW, printconf has been entirely re-written as system-config-printer for Fedora
Core 6.
Comment 3 Tim Waugh 2006-08-16 07:25:40 EDT
Please try this test update:


You should be able to get this using the command:

  yum --enablerepo=updates-testing update 'system-config-printer*'

as root.
Comment 4 Tim Waugh 2007-04-29 11:07:46 EDT
Reported confirms fix.

Note You need to log in before you can comment on or make changes to this bug.