Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConfigParser: Document items() added the vars dictionary to the result #56245

Closed
IsaacJurado mannequin opened this issue May 9, 2011 · 3 comments
Closed

ConfigParser: Document items() added the vars dictionary to the result #56245

IsaacJurado mannequin opened this issue May 9, 2011 · 3 comments
Assignees
Labels
docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error

Comments

@IsaacJurado
Copy link
Mannequin

IsaacJurado mannequin commented May 9, 2011

BPO 12036
Nosy @ambv
Files
  • test.ini: Sample dumb config file.
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/ambv'
    closed_at = <Date 2011-05-09.16:51:08.676>
    created_at = <Date 2011-05-09.14:38:15.922>
    labels = ['type-bug', 'docs']
    title = 'ConfigParser: Document items() added the vars dictionary to the result'
    updated_at = <Date 2011-05-09.16:51:08.675>
    user = 'https://bugs.python.org/IsaacJurado'

    bugs.python.org fields:

    activity = <Date 2011-05-09.16:51:08.675>
    actor = 'python-dev'
    assignee = 'lukasz.langa'
    closed = True
    closed_date = <Date 2011-05-09.16:51:08.676>
    closer = 'python-dev'
    components = ['Documentation']
    creation = <Date 2011-05-09.14:38:15.922>
    creator = 'Isaac.Jurado'
    dependencies = []
    files = ['21942']
    hgrepos = []
    issue_num = 12036
    keywords = []
    message_count = 3.0
    messages = ['135591', '135610', '135613']
    nosy_count = 3.0
    nosy_names = ['lukasz.langa', 'python-dev', 'Isaac.Jurado']
    pr_nums = []
    priority = 'low'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue12036'
    versions = ['Python 3.2', 'Python 3.3']

    @IsaacJurado
    Copy link
    Mannequin Author

    IsaacJurado mannequin commented May 9, 2011

    From the following python code:

    import os
    from ConfigParser import ConfigParser
    from pprint import pprint
    c = ConfigParser()
    c.read(['test.ini'])
    pprint(c.items('test', raw=False, vars=os.environ))

    I see the values contained in os.environ as well as in section "test" (in the attached configuration example).

    The problem seems to come from the following line:

    http://hg.python.org/cpython/file/5395f96588d4/Lib/ConfigParser.py#l605

    Which is fixed in py3k but for the 2.x branch has not been modified sin 2002:

    http://hg.python.org/cpython/annotate/8bb6003f7f54/Lib/ConfigParser.py#514

    @IsaacJurado IsaacJurado mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels May 9, 2011
    @ambv
    Copy link
    Contributor

    ambv commented May 9, 2011

    This annoyance can't be fixed in 2.x anymore since this is a change of behaviour requiring a full release. While it is very unlikely someone depended on this "feature", changing it breaks compatibility.

    Reclassified as Documentation to explicitly describe that change in 3.2.

    @ambv ambv added docs Documentation in the Doc dir and removed stdlib Python modules in the Lib dir labels May 9, 2011
    @ambv ambv self-assigned this May 9, 2011
    @ambv ambv changed the title ConfigParser: items() adds the vars dictionary to the result ConfigParser: Document items() added the vars dictionary to the result May 9, 2011
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented May 9, 2011

    New changeset 62e2b74c3bfc by Łukasz Langa in branch '3.2':
    Closes bpo-12036: ConfigParser: Document items() added the vars dictionary to the result
    http://hg.python.org/cpython/rev/62e2b74c3bfc

    New changeset 2d984cc4afb0 by Łukasz Langa in branch 'default':
    Merged solution for bpo-12036 from 3.2
    http://hg.python.org/cpython/rev/2d984cc4afb0

    @python-dev python-dev mannequin closed this as completed May 9, 2011
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant