Bug 842323

Summary: Unit tests show an error in _delitem_ function
Product: Red Hat Enterprise Linux 5 Reporter: Filip Holec <fholec>
Component: python-iniparseAssignee: James Antill <james.antill>
Status: CLOSED NOTABUG QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: low Docs Contact:
Priority: unspecified    
Version: 5.9CC: psplicha
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-07-23 20:23:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Filip Holec 2012-07-23 13:40:02 UTC
Description of problem:
When testing program with unit tests, multiple errors show in _delitem_ function, mainly on line 339 : "if key in self._compat_skip_empty_lines:" in file 'ini.py'.

======================================================================
ERROR: test_delete (tests.test_ini.test_ini)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/tmp.TZdbt18521/tests/test_ini.py", line 233, in test_delete
    del p.section1.help
  File "/usr/lib/python2.4/site-packages/iniparse/config.py", line 98, in __delattr__
    self.__delitem__(name)
  File "/usr/lib/python2.4/site-packages/iniparse/ini.py", line 339, in __delitem__
    if key in self._compat_skip_empty_lines:
TypeError: iterable argument required

======================================================================
ERROR: test_basic (tests.test_compat.RawConfigParserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/tmp.TZdbt18521/tests/test_compat.py", line 69, in test_basic
    self.failUnless(cf.remove_option('Foo Bar', 'foo'),
  File "/usr/lib/python2.4/site-packages/iniparse/compat.py", line 174, in remove_option
    del sec[option]
  File "/usr/lib/python2.4/site-packages/iniparse/ini.py", line 339, in __delitem__
    if key in self._compat_skip_empty_lines:
TypeError: iterable argument required

======================================================================
ERROR: test_case_sensitivity (tests.test_compat.RawConfigParserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/tmp.TZdbt18521/tests/test_compat.py", line 103, in test_case_sensitivity
    cf.remove_option("a", "B")
  File "/usr/lib/python2.4/site-packages/iniparse/compat.py", line 174, in remove_option
    del sec[option]
  File "/usr/lib/python2.4/site-packages/iniparse/ini.py", line 339, in __delitem__
    if key in self._compat_skip_empty_lines:
TypeError: iterable argument required

======================================================================
ERROR: test_basic (tests.test_compat.ConfigParserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/tmp.TZdbt18521/tests/test_compat.py", line 69, in test_basic
    self.failUnless(cf.remove_option('Foo Bar', 'foo'),
  File "/usr/lib/python2.4/site-packages/iniparse/compat.py", line 174, in remove_option
    del sec[option]
  File "/usr/lib/python2.4/site-packages/iniparse/ini.py", line 339, in __delitem__
    if key in self._compat_skip_empty_lines:
TypeError: iterable argument required

======================================================================
ERROR: test_case_sensitivity (tests.test_compat.ConfigParserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/tmp.TZdbt18521/tests/test_compat.py", line 103, in test_case_sensitivity
    cf.remove_option("a", "B")
  File "/usr/lib/python2.4/site-packages/iniparse/compat.py", line 174, in remove_option
    del sec[option]
  File "/usr/lib/python2.4/site-packages/iniparse/ini.py", line 339, in __delitem__
    if key in self._compat_skip_empty_lines:
TypeError: iterable argument required

======================================================================
ERROR: test_basic (tests.test_compat.SafeConfigParserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/tmp.TZdbt18521/tests/test_compat.py", line 69, in test_basic
    self.failUnless(cf.remove_option('Foo Bar', 'foo'),
  File "/usr/lib/python2.4/site-packages/iniparse/compat.py", line 174, in remove_option
    del sec[option]
  File "/usr/lib/python2.4/site-packages/iniparse/ini.py", line 339, in __delitem__
    if key in self._compat_skip_empty_lines:
TypeError: iterable argument required

======================================================================
ERROR: test_case_sensitivity (tests.test_compat.SafeConfigParserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/tmp.TZdbt18521/tests/test_compat.py", line 103, in test_case_sensitivity
    cf.remove_option("a", "B")
  File "/usr/lib/python2.4/site-packages/iniparse/compat.py", line 174, in remove_option
    del sec[option]
  File "/usr/lib/python2.4/site-packages/iniparse/ini.py", line 339, in __delitem__
    if key in self._compat_skip_empty_lines:
TypeError: iterable argument required


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

How reproducible:
Always

Steps to Reproduce:
1. Download unit-tests from source RPM
2. Run the tests
3. View the results
  
Actual results:
Doctest: iniparse.config ... ok
Doctest: iniparse.config.BasicConfig ... ok
Doctest: iniparse.ini ... ok
test_invalid (tests.test_ini.test_section_line) ... ok
test_parsing (tests.test_ini.test_section_line) ... ok
test_preserve_indentation (tests.test_ini.test_section_line) ... ok
test_printing (tests.test_ini.test_section_line) ... ok
test_invalid (tests.test_ini.test_option_line) ... ok
test_parsing (tests.test_ini.test_option_line) ... ok
test_preserve_indentation (tests.test_ini.test_option_line) ... ok
test_printing (tests.test_ini.test_option_line) ... ok
test_invalid (tests.test_ini.test_comment_line) ... ok
test_parsing (tests.test_ini.test_comment_line) ... ok
test_continuation (tests.test_ini.test_other_lines) ... ok
test_empty (tests.test_ini.test_other_lines) ... ok
test_basic (tests.test_ini.test_ini) ... ok
test_compat_order (tests.test_ini.test_ini) ... ok
test_delete (tests.test_ini.test_ini) ... ERROR
test_invalid (tests.test_ini.test_ini) ... ok
test_lookup (tests.test_ini.test_ini) ... ok
test_order (tests.test_ini.test_ini) ... ok
test_assignment (tests.test_misc.test_optionxform_override) ... ok
test_derivedclass (tests.test_misc.test_optionxform_override) ... ok
test_dyanamic (tests.test_misc.test_optionxform_override) ... ok
test_readline_configparser (tests.test_misc.test_readline) ... ok
test_readline_iniconfig (tests.test_misc.test_readline) ... ok
test_read (tests.test_misc.test_multiline_with_comments) ... ok
test_write (tests.test_misc.test_multiline_with_comments) ... ok
test_read (tests.test_misc.test_empty_file) ... ok
test_write (tests.test_misc.test_empty_file) ... ok
test_basic (tests.test_compat.RawConfigParserTestCase) ... ERROR
test_boolean (tests.test_compat.RawConfigParserTestCase) ... ok
test_case_sensitivity (tests.test_compat.RawConfigParserTestCase) ... ERROR
test_default_case_sensitivity (tests.test_compat.RawConfigParserTestCase) ... ok
test_interpolation (tests.test_compat.RawConfigParserTestCase) ... ok
test_items (tests.test_compat.RawConfigParserTestCase) ... ok
test_parse_errors (tests.test_compat.RawConfigParserTestCase) ... ok
test_query_errors (tests.test_compat.RawConfigParserTestCase) ... ok
test_read_returns_file_list (tests.test_compat.RawConfigParserTestCase) ... ok
test_set_nonstring_types (tests.test_compat.RawConfigParserTestCase) ... ok
test_set_string_types (tests.test_compat.RawConfigParserTestCase) ... ok
test_weird_errors (tests.test_compat.RawConfigParserTestCase) ... ok
test_write (tests.test_compat.RawConfigParserTestCase) ... ok
test_basic (tests.test_compat.ConfigParserTestCase) ... ERROR
test_boolean (tests.test_compat.ConfigParserTestCase) ... ok
test_case_sensitivity (tests.test_compat.ConfigParserTestCase) ... ERROR
test_default_case_sensitivity (tests.test_compat.ConfigParserTestCase) ... ok
test_interpolation (tests.test_compat.ConfigParserTestCase) ... ok
test_interpolation_missing_value (tests.test_compat.ConfigParserTestCase) ... ok
test_items (tests.test_compat.ConfigParserTestCase) ... ok
test_parse_errors (tests.test_compat.ConfigParserTestCase) ... ok
test_query_errors (tests.test_compat.ConfigParserTestCase) ... ok
test_read_returns_file_list (tests.test_compat.ConfigParserTestCase) ... ok
test_set_nonstring_types (tests.test_compat.ConfigParserTestCase) ... ok
test_set_string_types (tests.test_compat.ConfigParserTestCase) ... ok
test_weird_errors (tests.test_compat.ConfigParserTestCase) ... ok
test_write (tests.test_compat.ConfigParserTestCase) ... ok
test_basic (tests.test_compat.SafeConfigParserTestCase) ... ERROR
test_boolean (tests.test_compat.SafeConfigParserTestCase) ... ok
test_case_sensitivity (tests.test_compat.SafeConfigParserTestCase) ... ERROR
test_default_case_sensitivity (tests.test_compat.SafeConfigParserTestCase) ... ok
test_interpolation (tests.test_compat.SafeConfigParserTestCase) ... ok
test_interpolation_missing_value (tests.test_compat.SafeConfigParserTestCase) ... ok
test_items (tests.test_compat.SafeConfigParserTestCase) ... ok
test_parse_errors (tests.test_compat.SafeConfigParserTestCase) ... ok
test_query_errors (tests.test_compat.SafeConfigParserTestCase) ... ok
test_read_returns_file_list (tests.test_compat.SafeConfigParserTestCase) ... ok
test_safe_interpolation (tests.test_compat.SafeConfigParserTestCase) ... ok
test_set_nonstring_types (tests.test_compat.SafeConfigParserTestCase) ... ok
test_set_string_types (tests.test_compat.SafeConfigParserTestCase) ... ok
test_weird_errors (tests.test_compat.SafeConfigParserTestCase) ... ok
test_write (tests.test_compat.SafeConfigParserTestCase) ... ok

======================================================================
ERROR: test_delete (tests.test_ini.test_ini)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/tmp.TZdbt18521/tests/test_ini.py", line 233, in test_delete
    del p.section1.help
  File "/usr/lib/python2.4/site-packages/iniparse/config.py", line 98, in __delattr__
    self.__delitem__(name)
  File "/usr/lib/python2.4/site-packages/iniparse/ini.py", line 339, in __delitem__
    if key in self._compat_skip_empty_lines:
TypeError: iterable argument required

======================================================================
ERROR: test_basic (tests.test_compat.RawConfigParserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/tmp.TZdbt18521/tests/test_compat.py", line 69, in test_basic
    self.failUnless(cf.remove_option('Foo Bar', 'foo'),
  File "/usr/lib/python2.4/site-packages/iniparse/compat.py", line 174, in remove_option
    del sec[option]
  File "/usr/lib/python2.4/site-packages/iniparse/ini.py", line 339, in __delitem__
    if key in self._compat_skip_empty_lines:
TypeError: iterable argument required

======================================================================
ERROR: test_case_sensitivity (tests.test_compat.RawConfigParserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/tmp.TZdbt18521/tests/test_compat.py", line 103, in test_case_sensitivity
    cf.remove_option("a", "B")
  File "/usr/lib/python2.4/site-packages/iniparse/compat.py", line 174, in remove_option
    del sec[option]
  File "/usr/lib/python2.4/site-packages/iniparse/ini.py", line 339, in __delitem__
    if key in self._compat_skip_empty_lines:
TypeError: iterable argument required

======================================================================
ERROR: test_basic (tests.test_compat.ConfigParserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/tmp.TZdbt18521/tests/test_compat.py", line 69, in test_basic
    self.failUnless(cf.remove_option('Foo Bar', 'foo'),
  File "/usr/lib/python2.4/site-packages/iniparse/compat.py", line 174, in remove_option
    del sec[option]
  File "/usr/lib/python2.4/site-packages/iniparse/ini.py", line 339, in __delitem__
    if key in self._compat_skip_empty_lines:
TypeError: iterable argument required

======================================================================
ERROR: test_case_sensitivity (tests.test_compat.ConfigParserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/tmp.TZdbt18521/tests/test_compat.py", line 103, in test_case_sensitivity
    cf.remove_option("a", "B")
  File "/usr/lib/python2.4/site-packages/iniparse/compat.py", line 174, in remove_option
    del sec[option]
  File "/usr/lib/python2.4/site-packages/iniparse/ini.py", line 339, in __delitem__
    if key in self._compat_skip_empty_lines:
TypeError: iterable argument required

======================================================================
ERROR: test_basic (tests.test_compat.SafeConfigParserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/tmp.TZdbt18521/tests/test_compat.py", line 69, in test_basic
    self.failUnless(cf.remove_option('Foo Bar', 'foo'),
  File "/usr/lib/python2.4/site-packages/iniparse/compat.py", line 174, in remove_option
    del sec[option]
  File "/usr/lib/python2.4/site-packages/iniparse/ini.py", line 339, in __delitem__
    if key in self._compat_skip_empty_lines:
TypeError: iterable argument required

======================================================================
ERROR: test_case_sensitivity (tests.test_compat.SafeConfigParserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/tmp.TZdbt18521/tests/test_compat.py", line 103, in test_case_sensitivity
    cf.remove_option("a", "B")
  File "/usr/lib/python2.4/site-packages/iniparse/compat.py", line 174, in remove_option
    del sec[option]
  File "/usr/lib/python2.4/site-packages/iniparse/ini.py", line 339, in __delitem__
    if key in self._compat_skip_empty_lines:
TypeError: iterable argument required

Expected results:
All tests will pass

Additional info:

Comment 1 James Antill 2012-07-23 20:23:53 UTC
 Not using the upstream patch anymore ... so this will go away.