This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: ConfigParser: whitespace leading comment lines
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: facundobatista, gregwillden
Priority: normal Keywords:

Created on 2006-10-12 21:19 by gregwillden, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg61020 - (view) Author: gregwillden (gregwillden) Date: 2006-10-12 21:19
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
msg62818 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2008-02-23 22:03
Duplicate of #1524825
History
Date User Action Args
2022-04-11 14:56:20adminsetgithub: 44121
2008-02-23 22:03:17facundobatistasetstatus: open -> closed
resolution: duplicate
messages: + msg62818
nosy: + facundobatista
2006-10-12 21:19:22gregwilldencreate