[issue26831] ConfigParser parsing failures with default_section and ExtendedInterpolation options

2022-02-17 Thread Łukasz Langa

Łukasz Langa  added the comment:

Note: the problem here was due to passing `ExtendedInterpolation` (the class) 
instead of `ExtendedInterpolation()` (the object). This is now fixed through 
BPO-41086.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26831] ConfigParser parsing failures with default_section and ExtendedInterpolation options

2016-04-23 Thread SilentGhost

SilentGhost added the comment:

I think there is some misunderstanding of what default_section is supposed to 
do, in fact in provides default values for *other* section, as the 
documentation says, it doesn't mangle section separation.

In case of ExtendedInterpolation, the interpolation argument needs to be 
instantiated, i.e. the call should be:
ConfigParser(interpolation=ExtendedInterpolation())

--
nosy: +SilentGhost, lukasz.langa
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26831] ConfigParser parsing failures with default_section and ExtendedInterpolation options

2016-04-22 Thread Hans-Peter Jansen

New submission from Hans-Peter Jansen:

ConfigParser fails in interesting ways, when using default_section and 
ExtendedInterpolation options. Running the attached script results in: 

ConfigParser() with expected result:
global: [('loglevel', 'WARNING'), ('logfile', '-')]
section1: [('key_a', 'value'), ('key_b', 'morevalue')]
section2: [('key_c', 'othervalue'), ('key_d', 'differentvalue')]

ConfigParser(default_section='global') mangles section separation:
section1: [('loglevel', 'WARNING'), ('logfile', '-'), ('key_a', 'value'), 
('key_b', 'morevalue')]
section2: [('loglevel', 'WARNING'), ('logfile', '-'), ('key_c', 'othervalue'), 
('key_d', 'differentvalue')]

ConfigParser(interpolation=ExtendedInterpolation) fails with strange error:
Traceback (most recent call last):
  File "configparser-test.py", line 36, in 
print_sections(cp)
  File "configparser-test.py", line 21, in print_sections
cp.read_string(__doc__)
  File "/usr/lib64/python3.4/configparser.py", line 696, in read_string
self.read_file(sfile, source)
  File "/usr/lib64/python3.4/configparser.py", line 691, in read_file
self._read(f, source)
  File "/usr/lib64/python3.4/configparser.py", line 1089, in _read
self._join_multiline_values()
  File "/usr/lib64/python3.4/configparser.py", line 1101, in 
_join_multiline_values
name, val)
TypeError: before_read() missing 1 required positional argument: 'value'

while it is expected to behave identical.

--
components: Library (Lib)
files: configparser-test.py
messages: 264031
nosy: frispete
priority: normal
severity: normal
status: open
title: ConfigParser parsing failures with default_section and 
ExtendedInterpolation options
versions: Python 3.4
Added file: http://bugs.python.org/file42573/configparser-test.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com