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: whitespace leading comment lines #44121

Closed
gregwillden mannequin opened this issue Oct 12, 2006 · 2 comments
Closed

ConfigParser: whitespace leading comment lines #44121

gregwillden mannequin opened this issue Oct 12, 2006 · 2 comments
Labels
stdlib Python modules in the Lib dir

Comments

@gregwillden
Copy link
Mannequin

gregwillden mannequin commented Oct 12, 2006

BPO 1576208
Nosy @facundobatista

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-02-23.22:03:17.795>
created_at = <Date 2006-10-12.21:19:22.000>
labels = ['library']
title = 'ConfigParser: whitespace leading comment lines'
updated_at = <Date 2008-02-23.22:03:17.793>
user = 'https://bugs.python.org/gregwillden'

bugs.python.org fields:

activity = <Date 2008-02-23.22:03:17.793>
actor = 'facundobatista'
assignee = 'none'
closed = True
closed_date = <Date 2008-02-23.22:03:17.795>
closer = 'facundobatista'
components = ['Library (Lib)']
creation = <Date 2006-10-12.21:19:22.000>
creator = 'gregwillden'
dependencies = []
files = []
hgrepos = []
issue_num = 1576208
keywords = []
message_count = 2.0
messages = ['61020', '62818']
nosy_count = 2.0
nosy_names = ['facundobatista', 'gregwillden']
pr_nums = []
priority = 'normal'
resolution = 'duplicate'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1576208'
versions = []

@gregwillden
Copy link
Mannequin Author

gregwillden mannequin commented Oct 12, 2006

I'd like to propose the following change to
ConfigParser.py.
This change will enable multiline comments as follows:

[section]
item=value ;first of multiline comment
;second of multiline comment

Right now the behaviour is

In [19]: cfg.get('section','item')
Out[19]: 'value\n;second of multiline comment'

It's a one-line change.
RawConfigParser._read lines 434-437
# comment or blank line?

  •        if line.strip() == '' or line[0] in '#;':
    

+ if line.strip() == '' or line.strip()[0]
in '#;':
continue

@gregwillden gregwillden mannequin added stdlib Python modules in the Lib dir labels Oct 12, 2006
@facundobatista
Copy link
Member

Duplicate of bpo-1524825

@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
stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

1 participant