[issue22253] ConfigParser does not handle files without sections

2019-11-05 Thread Pedro Lacerda
Pedro Lacerda added the comment: Hi, there is a working PR at https://github.com/python/cpython/pull/2735. I was in doubt about get the default section with `__init__(..., allow_unnamed_section=True)` and `config.get('', 'option')` or with `config.get(DEFAULT_SECTION, 'option')`. I'd prefer

[issue22253] ConfigParser does not handle files without sections

2019-05-27 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue22253] ConfigParser does not handle files without sections

2019-05-27 Thread Joannah Nanjekye
Change by Joannah Nanjekye : -- stage: needs patch -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue22253] ConfigParser does not handle files without sections

2017-07-16 Thread Pedro Lacerda
Pedro Lacerda added the comment: Thank you 林自均! I just made a pull-request with the relevant bits. -- ___ Python tracker ___ ___ Pytho

[issue22253] ConfigParser does not handle files without sections

2017-07-16 Thread Roundup Robot
Changes by Roundup Robot : -- pull_requests: +2795 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue22253] ConfigParser does not handle files without sections

2017-07-13 Thread 林自均
林自均 added the comment: Hi Pedro Lacerda, I think you should submit your patch as a GitHub pull request. Please correct me if I'm wrong. Thanks. -- nosy: +林自均 ___ Python tracker ___

[issue22253] ConfigParser does not handle files without sections

2016-06-11 Thread Pedro Lacerda
Pedro Lacerda added the comment: I also never found a mixture of sectionless options followed by sectioned options. So an unnamed section that is also the DEFAULTSECTION will probably work. In this patch when `default_section=None` is passed to `RawConfigParser` it will parse top level option

[issue22253] ConfigParser does not handle files without sections

2014-09-27 Thread Martin Panter
Martin Panter added the comment: See also Issue 549037, about handling files with a single anonymous section -- ___ Python tracker ___ ___

[issue22253] ConfigParser does not handle files without sections

2014-09-15 Thread Terry J. Reedy
Terry J. Reedy added the comment: I read the rsyncd.conf doc at http://linux.die.net/man/5/rsyncd.conf (linked from the StackOverflow question). These files are not .ini files. However, I believe the parsing rules are mostly compatible with RawConfigParser, or could be made so by using existi

[issue22253] ConfigParser does not handle files without sections

2014-09-15 Thread Łukasz Langa
Łukasz Langa added the comment: I don't like the idea to magically introduce a '' section since this behaviour would be confusing for interpolation and not particularly discoverable by programmers. Let alone bikeshedding if this should rather be a None section. Using DEFAULTSECT for this purpo

[issue22253] ConfigParser does not handle files without sections

2014-09-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Microsoft Windows INI files, "POSIX-compatible config files", and other formats (e.g. Java properties files) use different methods for escaping, quoting, line continuing, interpolations, etc. Actually there are more differences than similarity between them.

[issue22253] ConfigParser does not handle files without sections

2014-09-12 Thread kernc
kernc added the comment: > > I am dubious that there are any with a mixture of both sections and > additional option lines at the top without a section. > rsyncd.conf [1] is one such example, and I wouldn't say there aren't countless more in the wild. > Anyone writing an app and planning to par

[issue22253] ConfigParser does not handle files without sections

2014-09-08 Thread Terry J. Reedy
Terry J. Reedy added the comment: The MS function GetPrivateProfileString appears to require sections. http://msdn.microsoft.com/en-us/library/ms724353.aspx On the other hand, it does not appear to do interpolation, so we have already not restricted ourselves to the MS function. In looking thro

[issue22253] ConfigParser does not handle files without sections

2014-09-08 Thread Paul Moore
Paul Moore added the comment: It's not unreasonable as a new feature, but the default behaviour shouldn't change. It matches ini files (like it or not, ConfigParser parses ini-style files - the docs even say so), and sectionless values are not standard ini format. I'd suggest a new __init__ o

[issue22253] ConfigParser does not handle files without sections

2014-09-08 Thread Guido van Rossum
Guido van Rossum added the comment: It looks like this feature request tries to change an existing (ancient) module into something it isn't. At the very least can you point to a spec for the syntax of "POSIX" config files? I always thought they were essentially shell scripts, which suggests

[issue22253] ConfigParser does not handle files without sections

2014-09-04 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue22253] ConfigParser does not handle files without sections

2014-09-02 Thread Tshepang Lekhonkhobe
Changes by Tshepang Lekhonkhobe : -- nosy: +tshepang ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue22253] ConfigParser does not handle files without sections

2014-08-22 Thread kernc
kernc added the comment: I, for one, would actually prefer if global options were parsed by default and MissingSectionHeaderError was deprecated instead. >From what little specification available, INI format does **not** require >options be in sections [4, 5]. Additionally, "Linux and Unix sys

[issue22253] ConfigParser does not handle files without sections

2014-08-22 Thread Łukasz Langa
Łukasz Langa added the comment: That's an interesting feature request. Parsing it only while `strict=False` sounds like a good plan. -- assignee: -> lukasz.langa nosy: +lukasz.langa stage: -> needs patch type: behavior -> enhancement versions: -Python 2.7, Python 3.2 ___

[issue22253] ConfigParser does not handle files without sections

2014-08-22 Thread kernc
New submission from kernc: ConfigParser does not handle files that specify options in the "global" section (first option specified before any section is). This configuration "behavior" is present in the configuration files in the wild [1, 2], and while the naive workaround is simple, ... reall