[New-bugs-announce] [issue33150] Signature error for methods of class configparser.Interpolation

Arno-Can Uestuensoez report at bugs.python.org
Mon Mar 26 22:39:48 EDT 2018


New submission from Arno-Can Uestuensoez <acue.opensource at gmail.com>:

I am not sure whether this is already covered by an issue, it is present in 3.6.2 and 3.6.4.

The class Interpolation in the configparser module causes an exception:

  File "/opt/python/python-3.6.4/lib/python3.6/configparser.py", line 1123, in _join_multiline_values
    name, val)
TypeError: before_read() missing 1 required positional argument: 'value'


This is due to the missing 'parser' parameter at the call of 'Interploation.xyz()' methods, also the case for several other method calls.


class Interpolation:
    """Dummy interpolation that passes the value through with no changes."""

    def before_read(self, parser, section, option, value):
        return value

   ...

Same for derived classes see e.g.

   class BasicInterpolation(Interpolation):
   ...

   class ExtendedInterpolation(Interpolation):
   ...

A work around seems to be:

- defining a dummy with changed signatures as parameter 'interpolation'

----------
components: Argument Clinic, Build, asyncio
messages: 314493
nosy: acue, asvetlov, larry, yselivanov
priority: normal
severity: normal
status: open
title: Signature error for methods of class configparser.Interpolation
type: compile error
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33150>
_______________________________________


More information about the New-bugs-announce mailing list