Skip to content

deepcopy in py3k evaluates interpolated strings #188

Open
@WeatherGod

Description

@WeatherGod

Consider the following code example:

from __future__ import print_function
from copy import deepcopy
from configobj import ConfigObj
conf = ConfigObj()
conf['foo'] = 'bar'
conf['baz'] = '%(foo)s.txt'
conf_new = deepcopy(conf)
conf_new['foo'] = 'abc'
print(conf_new['bar'])

In python 2.7, the output is "abc.txt". In python 3.7, the output is 'bar.txt', which is the value of the 'bar' key in the original config object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions