Bug 753891

Summary: python-iniparse's defaults() function results in "ValueError: too many values to unpack"
Product: Red Hat Enterprise Linux 5 Reporter: Alex Wood <awood>
Component: python-iniparseAssignee: James Antill <james.antill>
Status: CLOSED ERRATA QA Contact: Filip Holec <fholec>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 5.7CC: bnater, fholec, pknirsch, psplicha
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-iniparse-0.2.3-6.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-07-31 15:44:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Script to test this bug. none

Description Alex Wood 2011-11-14 19:10:41 UTC
Description of problem:
When using the defaults() function in python-iniparse, a "ValueError: too many values to unpack" is printed.

Version-Release number of selected component (if applicable):  python-iniparse-0.2.3-4.el5

How reproducible: Always

Steps to Reproduce:
1. Download the attached script to a RHEL 5.7 machine.
2. Run the script
3. View the results
  
Actual results:
CORRECTED BEHAVIOR
{'foo': 'bar'}

ORIGINAL BEHAVIOR
Traceback (most recent call last):
  File "./defaults.py", line 30, in ?
    print cp.defaults()
  File "/usr/lib/python2.4/site-packages/iniparse/compat.py", line 38, in defaults
    for name, lineobj in self.data._defaults._options:
ValueError: too many values to unpack

Expected results:
CORRECTED BEHAVIOR
{'foo': 'bar'}

ORIGINAL BEHAVIOR
{'foo': 'bar'}

Additional info:
See http://code.google.com/p/iniparse/issues/detail?id=9

Comment 1 Alex Wood 2011-11-14 19:13:15 UTC
Created attachment 533603 [details]
Script to test this bug.

Comment 4 Filip Holec 2012-07-23 15:27:21 UTC
Running the script with python-iniparse-0.2.3-5.el5 causes error :

CORRECTED BEHAVIOR
{'foo': 'bar'}

ORIGINAL BEHAVIOR
Traceback (most recent call last):
  File "./defaults.py", line 30, in ?
    print cp.defaults()
  File "/usr/lib/python2.4/site-packages/iniparse/compat.py", line 40, in defaults
    d[name] = secobj._compat_get(name)
TypeError: 'Undefined' object is not callable

(+ failed unit-tests https://bugzilla.redhat.com/show_bug.cgi?id=842323)

--------------------------------------------------------------

Testing on :

DISTRO = RHEL5-Server-U8
ARCHITECTURE = x86_64

Comment 5 James Antill 2012-07-23 20:24:02 UTC
 Ok, I just used the fix from the test code instead of the upstream fix (as that appears to rely on other changes which we don't have).

Comment 9 errata-xmlrpc 2012-07-31 15:44:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-1128.html