[issue44892] Configparser fails when the .cfg file contains comments

2021-09-25 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Please report back on the pip issue to read more of the doc, about inline 
comments in
https://docs.python.org/3/library/configparser.html#customizing-parser-behaviour
like I should have before writing what I did.

--
resolution:  -> not a bug
stage: test needed -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44892] Configparser fails when the .cfg file contains comments

2021-09-25 Thread Diego Ramirez


Diego Ramirez  added the comment:

Hi Terry, I didn't see your response. I think this won't be possible, taking in 
count the comment that Serhiy posted:

> By default configparser does not support inline comments. "#  percentage sign 
> '%'" is a part of value. If you want to support inline comments you should 
> pass the inline_comment_prefixes argument.

Maybe this is a reasonable behavior. What do you think about it?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44892] Configparser fails when the .cfg file contains comments

2021-09-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

By default configparser does not support inline comments. "#  percentage sign 
'%'" is a part of value. If you want to support inline comments you should pass 
the inline_comment_prefixes argument.

But note that it can break parsing existing valid config files containing such 
prefixes. For example "background=#ff" or 
"path=C:\Python\bin;D:\Users\Me\bin" if use standard comment prefixes "#" and 
";". This is why it is disabled by default.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44892] Configparser fails when the .cfg file contains comments

2021-09-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Make PR branch from main, which I used for testing. I verified issue on 3.10 
and 3.9, so we will backport.

--
stage: needs patch -> test needed
title: Configparser fails when the file contains $ inside a comment -> 
Configparser fails when the .cfg file contains comments
versions: +Python 3.10, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com