Bug 194433 - [patch]printconf: browse_smb_hosts: local variable 'iter' referenced before assignment
Summary: [patch]printconf: browse_smb_hosts: local variable 'iter' referenced before a...
Alias: None
Product: Fedora
Classification: Fedora
Component: system-config-printer   
(Show other bugs)
Version: 5
Hardware: All Linux
Target Milestone: ---
Assignee: Tim Waugh
QA Contact:
Keywords: Reopened
Depends On:
TreeView+ depends on / blocked
Reported: 2006-06-08 03:35 UTC by Scott Tsai
Modified: 2008-03-12 05:57 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-03-12 05:57:01 UTC
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-08 03:35 UTC, Scott Tsai
no flags Details | Diff

Description Scott Tsai 2006-06-08 03:35:36 UTC
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-08 03:35:36 UTC
Created attachment 130721 [details]
Assign "iter" to None before the loop, check it afterwards.

Comment 2 Tim Waugh 2006-06-20 13:26:41 UTC
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 11:25:40 UTC
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 15:07:46 UTC
Reported confirms fix.

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