classification
Title: ConfigParser(interpolation=None) doesn't work
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.3, Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: lukasz.langa Nosy List: eric.araujo, lukasz.langa, python-dev, tbrink
Priority: normal Keywords: needs review, patch

Created on 2011-02-25 20:37 by tbrink, last changed 2011-04-30 07:47 by python-dev. This issue is now closed.

Files
File name Uploaded Description Edit
configparser_interpolation.patch tbrink, 2011-02-25 20:37
patch_with_test.diff tbrink, 2011-03-01 13:21 review
Messages (8)
msg129421 - (view) Author: Tobias Brink (tbrink) Date: 2011-02-25 20:37
The docs for Python 3.2 say that p = configparser.ConfigParser(interpolation=None) disables interpolation.  Instead it gives this traceback when calling p.read():

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.2/configparser.py", line 688, in read
    self._read(fp, filename)
  File "/usr/lib/python3.2/configparser.py", line 1081, in _read
    self._join_multiline_values()
  File "/usr/lib/python3.2/configparser.py", line 1091, in _join_multiline_values
    options[name] = self._interpolation.before_read(self,
AttributeError: 'NoneType' object has no attribute 'before_read'

The attached patch should fix it.
msg129580 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-02-26 17:45
Thanks.  Could you also add a test?
msg129759 - (view) Author: Tobias Brink (tbrink) Date: 2011-03-01 13:21
I added a test but I am not too familiar with the Python test suite.  Please check if the "test_init_takes_interpolation_none" test is necessary because the test suite also fails without it if my patch is not applied.  Feel free to remove it if it is superfluous.
msg129766 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-03-01 13:38
Thanks, the configparser maintainer will review your patch.

Łukasz, you may want to use assertIsNone when you commit.
msg134682 - (view) Author: Roundup Robot (python-dev) Date: 2011-04-28 15:04
New changeset 32031e33d793 by Łukasz Langa in branch '3.2':
Closes #11324: ConfigParser(interpolation=None) doesn't work.
http://hg.python.org/cpython/rev/32031e33d793

New changeset de7dc59260b1 by Łukasz Langa in branch 'default':
Merged solution for #11324 from 3.2.
http://hg.python.org/cpython/rev/de7dc59260b1
msg134772 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-04-29 14:53
You forgot the Misc/NEWS entry.
msg134844 - (view) Author: Roundup Robot (python-dev) Date: 2011-04-30 07:47
New changeset 08996a664ed3 by Łukasz Langa in branch '3.2':
Mentioned issues #11324 and #11858.
http://hg.python.org/cpython/rev/08996a664ed3
msg134845 - (view) Author: Roundup Robot (python-dev) Date: 2011-04-30 07:47
New changeset 0c21de0cca44 by Łukasz Langa in branch 'default':
Merged mentions of issues #11324 and #11858.
http://hg.python.org/cpython/rev/0c21de0cca44
History
Date User Action Args
2011-08-03 22:15:27lukasz.langalinkissue12688 superseder
2011-04-30 07:47:42python-devsetmessages: + msg134845
2011-04-30 07:47:30python-devsetmessages: + msg134844
2011-04-29 14:53:27eric.araujosetmessages: + msg134772
2011-04-28 15:04:42python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg134682

resolution: fixed
stage: patch review -> resolved
2011-03-01 13:38:15eric.araujosetkeywords: + needs review
messages: + msg129766
nosy: eric.araujo, lukasz.langa, tbrink
stage: patch review
2011-03-01 13:21:12tbrinksetfiles: + patch_with_test.diff
nosy: eric.araujo, lukasz.langa, tbrink
messages: + msg129759
2011-02-26 17:45:20eric.araujosetnosy: + eric.araujo
messages: + msg129580
2011-02-25 20:38:36brian.curtinsetassignee: lukasz.langa

nosy: + lukasz.langa
2011-02-25 20:37:07tbrinkcreate