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...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: system-config-printer
Version: 5
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
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:
Clone Of:
Environment:
Last Closed: 2008-03-12 05:57:01 UTC
Type: ---
Embargoed:


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):
system-config-printer-gui-0.6.151.7-1

How reproducible:
Always.
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:

https://www.redhat.com/archives/fedora-test-list/2006-August/msg00259.html

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.