[issue6517] configparser: add possibility to escape formatstrings

2010-07-26 Thread R. David Murray
R. David Murray added the comment: You are right, IMO, at least the current doc patch should be applied. Please go ahead, if you want to, I won't have time to get to it for a couple of days. Maybe you could come up with a new title for this issue that reflects the concerns being addressed he

[issue6517] configparser: add possibility to escape formatstrings

2010-07-26 Thread Michael Foord
Michael Foord added the comment: It is (very) unfortunate that configparser.ConfigParser should *not* be used and that configparser.SafeConfigParser is the correct class instead. I would be *in favour* of deprecating ConfigParser and eventually renaming SafeConfigParser back to ConfigParser (

[issue6517] configparser: add possibility to escape formatstrings

2010-07-26 Thread Michael Foord
Michael Foord added the comment: This should just be applied. I'll do it shortly unless there is an objection. -- nosy: +michael.foord ___ Python tracker ___

[issue6517] configparser: add possibility to escape formatstrings

2010-07-24 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. added the comment: We're in agreement; I was specifically adding weight to *not* selecting the second optoin Łukasz Langa presented: > 2. We deprecate ConfigParser in the code and in the documentation. -- ___ Python tracker

[issue6517] configparser: add possibility to escape formatstrings

2010-07-23 Thread Łukasz Langa
Łukasz Langa added the comment: > The documentation should promote RawConfigParser, and note > SafeConfigParser and ConfigParser as remaining for backward > compatibility for existing software. That is another way to go around this. Anyway, ConfigParser is the least predictable of all three f

[issue6517] configparser: add possibility to escape formatstrings

2010-07-23 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. added the comment: I disagree. The documentation should promote RawConfigParser, and note SafeConfigParser and ConfigParser as remaining for backward compatibility for existing software. Maintainers of legacy software using ConfigParser should be encouraged to convert to Saf

[issue6517] configparser: add possibility to escape formatstrings

2010-07-23 Thread Łukasz Langa
Łukasz Langa added the comment: This issue superseeds # because of the patches attached. Brett, there are two ways we can solve this issue: 1. Rewrite the documentation so it clearly puts more emphasis on the fact that SafeConfigParser is the one to choose. 2. We deprecate ConfigParser in

[issue6517] configparser: add possibility to escape formatstrings

2009-09-15 Thread Fred L. Drake, Jr.
Changes by Fred L. Drake, Jr. : -- nosy: +fdrake ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue6517] configparser: add possibility to escape formatstrings

2009-07-18 Thread Till Maas
Till Maas added the comment: It would be nice if you could expand the patch to also use only one name for the support of format strings. In the beginning it is introduced as "reference expansion", but later in the document, several variatons of interpolation are used: "magical interpolation", "

[issue6517] configparser: add possibility to escape formatstrings

2009-07-18 Thread R. David Murray
R. David Murray added the comment: Ah, that's because you aren't using SafeConfigParser (which the docs recommend that you do unless you have to use ConfigParser for backward compatibility reasons). Your test case works with SafeConfigParser. You are correct that it is not explicitly documente

[issue6517] configparser: add possibility to escape formatstrings

2009-07-18 Thread Till Maas
Till Maas added the comment: Afacs it is not documented to work. Here is the testcase: #!/usr/bin/python # vim: fileencoding=utf8 import ConfigParser import tempfile file = tempfile.TemporaryFile(mode='rw+b') file.write("[s]\nf=%%(b)s\n") file.seek(0) config = ConfigParser.ConfigParser() con

[issue6517] configparser: add possibility to escape formatstrings

2009-07-18 Thread R. David Murray
R. David Murray added the comment: The formatstring is a Python % formatting code, and doubling the %% is the way to escape one, so what you suggest is in fact the way it works. Do you have a test case demonstrating that it doesn't work as documented (it works for me)? -- nosy: +r.davi

[issue6517] configparser: add possibility to escape formatstrings

2009-07-18 Thread Till Maas
New submission from Till Maas : There seems to be no way to add a config item with a value containing a formatstring without this formatstring beeing handled by configparser. A possible way to escape the formatstrings could be to double the %-sign, e.g.: [foo] bar = %%(string)s The value of th