[New-bugs-announce] [issue31307] ConfigParser.read silently fails if filenames argument is a byte string

Vincent Michel report at bugs.python.org
Wed Aug 30 10:15:47 EDT 2017


New submission from Vincent Michel:

Calling `config_parser.read` with `'test'` is equivalent to:

    config_parser.read(['test'])

while calling `config_parser.read` with `b'test'` is treated as:

    config_parser.read([116, 101, 115, 116])

which means python will try to open the file descriptors 101, 115 and 116.

I don't know if byte path should be supported, but this is probably not the expected behavior.

The method code: https://github.com/python/cpython/blob/master/Lib/configparser.py#L678-L702

----------
components: Library (Lib)
messages: 301026
nosy: vxgmichel
priority: normal
severity: normal
status: open
title: ConfigParser.read silently fails if filenames argument is a byte string
type: behavior
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue31307>
_______________________________________


More information about the New-bugs-announce mailing list