[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

[issue27268] Incorrect error message on float('')

2017-07-17 Thread Pedro Lacerda
Changes by Pedro Lacerda <pslace...@gmail.com>: -- pull_requests: +2805 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27268> ___

[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 <rep...@bugs.python.org> <http://bugs.python.org/i

[issue27258] Exception in BytesGenerator.flatten

2016-06-18 Thread Pedro Lacerda
Pedro Lacerda added the comment: Now the file is back! If any previous header has a newline before the value the error will not happen. But even with the output correct it isn't as expected. -- Added file: http://bugs.python.org/file43457/flatten-no-exception.mail

[issue27258] Exception in BytesGenerator.flatten

2016-06-18 Thread Pedro Lacerda
Pedro Lacerda added the comment: Now the file is back! If any previous header has a newline before the value the error will not happen. But even with the output correct it isn't as expected. -- Added file: http://bugs.python.org/file43456/flatten-no-exception.mail

[issue27258] Exception in BytesGenerator.flatten

2016-06-17 Thread Pedro Lacerda
Pedro Lacerda added the comment: Seems that ``token.has_fws`` evaluates to True in the following condition if token.has_fws: causing ``token._fold(self)`` where isn't needed and raising the exception. Hope it helps! By the way, why the _header_value_parser.py was removed from

[issue27258] Exception in BytesGenerator.flatten

2016-06-16 Thread Pedro Lacerda
Pedro Lacerda added the comment: I was unable to reproduce this bug using the following snippet import email, sys from email.generator import BytesGenerator from email.mime.text import MIMEText fp = open('flatten-exception.mail', 'rb') email.message_from_binary_file(fp

[issue27268] Incorrect error message on float('')

2016-06-16 Thread Pedro Lacerda
Pedro Lacerda added the comment: Following the bug pointed by Adam and Eryk. -- keywords: +patch nosy: +Pedro Lacerda Added file: http://bugs.python.org/file43405/float.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.p

[issue26836] Add memfd_create to os module

2016-06-16 Thread Pedro Lacerda
Pedro Lacerda added the comment: Maybe useful at mmapmodule.c replacing /* SVR4 method to map anonymous memory is to open /dev/zero */ fd = devzero = _Py_open("/dev/zero", O_RDWR); tagname is unused at UNIX version of new_mmap_object() so if provided something

[issue27320] ./setup.py --help-commands should sort extra commands

2016-06-15 Thread Pedro Lacerda
Pedro Lacerda added the comment: Please look if these simple patches are acceptable. I don't know if standard commands are already in a sane order or if it also need to be sorted. -- keywords: +patch nosy: +Pedro Lacerda Added file: http://bugs.python.org/file43402/sortextra.patch

[issue27320] ./setup.py --help-commands should sort extra commands

2016-06-15 Thread Pedro Lacerda
Changes by Pedro Lacerda <pslace...@gmail.com>: Added file: http://bugs.python.org/file43403/sortcommands.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[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