This service will be undergoing maintenance at 20:00 UTC, 2017-04-03. It is expected to last about 30 minutes
Bug 433259 - UnboundLocalError: local variable 'line' referenced before assignment
UnboundLocalError: local variable 'line' referenced before assignment
Product: Fedora
Classification: Fedora
Component: python-iniparse (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Tim Lauridsen
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2008-02-18 02:28 EST by Andrew Farris
Modified: 2014-01-21 18:02 EST (History)
5 users (show)

See Also:
Fixed In Version: 0.2.3
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-02-21 07:22:03 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Andrew Farris 2008-02-18 02:28:39 EST
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):

Additional info:

Component: pirut
Summary: TB29ec97ad local variable 'line'
referenced before assignment

Traceback (most recent call last):
File "/usr/sbin/pirut", line 476, in <module>
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/", line 129, in __init__
File "/usr/lib/python2.5/site-packages/yum/", line 113, in doConfigSetup
File "/usr/lib/python2.5/site-packages/yum/", line 164, in _getConfig
File "/usr/lib/python2.5/site-packages/yum/", line 229, in
File "/usr/lib/python2.5/site-packages/iniparse/", line 106, in readfp
File "/usr/lib/python2.5/site-packages/iniparse/", 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
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:
Comment 1 Tim Lauridsen 2008-02-21 07:22:03 EST
look like you are running a older release of python-iniparse, this issue is
fixed in the lastest releases.

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