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 DEFAULT #48895

Closed
shawnashlee mannequin opened this issue Dec 12, 2008 · 3 comments
Closed

configparser DEFAULT #48895

shawnashlee mannequin opened this issue Dec 12, 2008 · 3 comments
Labels
extension-modules C modules in the Modules dir

Comments

@shawnashlee
Copy link
Mannequin

shawnashlee mannequin commented Dec 12, 2008

BPO 4645
Nosy @loewis

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 = None
closed_at = <Date 2008-12-14.19:37:44.347>
created_at = <Date 2008-12-12.20:09:15.855>
labels = ['extension-modules']
title = 'configparser DEFAULT'
updated_at = <Date 2008-12-14.19:37:44.346>
user = 'https://bugs.python.org/shawnashlee'

bugs.python.org fields:

activity = <Date 2008-12-14.19:37:44.346>
actor = 'loewis'
assignee = 'none'
closed = True
closed_date = <Date 2008-12-14.19:37:44.347>
closer = 'loewis'
components = ['Extension Modules']
creation = <Date 2008-12-12.20:09:15.855>
creator = 'shawn.ashlee'
dependencies = []
files = []
hgrepos = []
issue_num = 4645
keywords = []
message_count = 3.0
messages = ['77686', '77702', '77817']
nosy_count = 3.0
nosy_names = ['loewis', 'quentin.gallet-gilles', 'shawn.ashlee']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue4645'
versions = ['Python 2.5.3']

@shawnashlee
Copy link
Mannequin Author

shawnashlee mannequin commented Dec 12, 2008

using .add_section() and .set() for the DEFAULT section adds it twice:

[user@srv ~]$ cat test_configparser.py
#!/usr/bin/env python

import ConfigParser

a = ConfigParser.SafeConfigParser()

# borked
a.add_section('DEFAULT')
a.set('DEFAULT', 'foo', 'bar')

# working
a.add_section('working')
a.set('working', 'foo', 'bar')

b = open('testing', 'w')
a.write(b)
b.close()

[user@srv ~]$ python test_configparser.py
[user@srv ~]$ cat testing
[DEFAULT]
foo = bar

[DEFAULT]

[working]
foo = bar

Tested with 2.4 and 2.5, py3k no longer allows DEFAULT to be passed, so
this is a python < 3k issue.

@shawnashlee shawnashlee mannequin added the extension-modules C modules in the Modules dir label Dec 12, 2008
@quentingallet-gilles
Copy link
Mannequin

quentingallet-gilles mannequin commented Dec 13, 2008

This is already fixed in 2.6 since r60976, the related issue is bpo-1781
I'm not sure this is a good candidate for 2.4.6 and 2.5.3 : this isn't a
security fix, but I doubt fixing this would break existing code as I
can't imagine people relying on this behavior.

Adding Martin to the nosy list so he can pronounce.

@loewis
Copy link
Mannequin

loewis mannequin commented Dec 14, 2008

The release candidate for 2.5.3 has been made; this patch cannot be
considered anymore.

Closing as fixed.

@loewis loewis mannequin closed this as completed Dec 14, 2008
@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
extension-modules C modules in the Modules dir
Projects
None yet
Development

No branches or pull requests

0 participants