Bug 433259

Summary: UnboundLocalError: local variable 'line' referenced before assignment
Product: [Fedora] Fedora Reporter: Andrew Farris <lordmorgul>
Component: python-iniparseAssignee: Tim Lauridsen <tim.lauridsen>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 8CC: ffesti, james.antill, katzj, pmatilai, tim.lauridsen
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 0.2.3 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-02-21 12:22:03 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andrew Farris 2008-02-18 07:28:39 UTC
Description of problem:
Traceback in pirut and yum due to configuration issue, .repo file with zero bytes.

Version-Release number of selected component (if applicable):
yum-3.2.7-1.fc8

Additional info:

Component: pirut
Summary: TB29ec97ad ini.py:563:readfp:UnboundLocalError: local variable 'line'
referenced before assignment

Traceback (most recent call last):
File "/usr/sbin/pirut", line 476, in <module>
main()
File "/usr/sbin/pirut", line 469, in main
pm = PackageManager(options.config, options.onlyrepo)
File "/usr/sbin/pirut", line 63, in __init__
GraphicalYumBase.__init__(self, False, config)
File "/usr/lib/python2.5/site-packages/pirut/__init__.py", line 129, in __init__
plugin_types=(yum.plugins.TYPE_CORE,))
File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 113, in doConfigSetup
errorlevel=errorlevel)
File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 164, in _getConfig
self.getReposFromConfig()
File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 229, in
getReposFromConfig
parser.readfp(confpp_obj)
File "/usr/lib/python2.5/site-packages/iniparse/compat.py", line 106, in readfp
self.data.readfp(fp)
File "/usr/lib/python2.5/site-packages/iniparse/ini.py", line 563, in readfp
if line and line[-1]=='\n':
UnboundLocalError: local variable 'line' referenced before assignment

Local variables in innermost frame:
pending_lines: []
fp: <yum.parser.ConfigPreProcessor instance at 0x8efe02c>
exc: None
self: 
cur_section_name: None
linecount: 0
cur_option_name: None
fname: file://///etc/yum.repos.d/compiz-fusion.repo
cur_option: None
cur_section: None


It appears user has a zero byte repo file which caused this.  Can this be
avoided by ignoring the repo file rather than assuming it contains configuration?

More info at: http://forums.fedoraforum.org/showthread.php?p=964765#post964765

Comment 1 Tim Lauridsen 2008-02-21 12:22:03 UTC
look like you are running a older release of python-iniparse, this issue is
fixed in the lastest releases.