Issue31307
Created on 2017-08-30 14:15 by vxgmichel, last changed 2017-11-02 12:49 by berker.peksag. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 3420 | merged | vxgmichel, 2017-09-07 12:06 | |
| Messages (5) | |||
|---|---|---|---|
| msg301026 - (view) | Author: Vincent Michel (vxgmichel) * | Date: 2017-08-30 14:15 | |
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
|
|||
| msg301149 - (view) | Author: Łukasz Langa (lukasz.langa) * | Date: 2017-09-01 19:48 | |
Good catch. Supporting bytes passed as a path is a reasonable request since the builtin `open()` supports this, too. Go ahead and create a pull request! We only need to modify line 690 to also list `bytes`. |
|||
| msg301192 - (view) | Author: David Ellis (David Ellis) * | Date: 2017-09-03 14:02 | |
This is related to the issue I'd brought up previously here so closing this would also close that issue: http://bugs.python.org/issue29627 I did originally attempt to add support for bytes in PR where I added support for Path-like objects: https://github.com/python/cpython/pull/242 but I was asked to take it back out. |
|||
| msg305421 - (view) | Author: Berker Peksag (berker.peksag) * | Date: 2017-11-02 12:47 | |
New changeset e314853d57450b2b9523157eebd405289a795a0e by Berker Peksag (Vincent Michel) in branch 'master': bpo-31307: Make ConfigParser.read() accept bytes objects (GH-3420) https://github.com/python/cpython/commit/e314853d57450b2b9523157eebd405289a795a0e |
|||
| msg305422 - (view) | Author: Berker Peksag (berker.peksag) * | Date: 2017-11-02 12:49 | |
Thanks! I went ahead and merged PR 3420 since Łukasz (the configparser maintainer) has accepted the idea. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2017-11-02 12:49:05 | berker.peksag | set | status: open -> closed type: behavior -> enhancement messages: + msg305422 resolution: fixed |
| 2017-11-02 12:47:06 | berker.peksag | set | nosy:
+ berker.peksag messages: + msg305421 |
| 2017-09-07 12:06:27 | vxgmichel | set | pull_requests: + pull_request3417 |
| 2017-09-05 17:52:56 | lukasz.langa | link | issue29627 superseder |
| 2017-09-03 14:02:16 | David Ellis | set | nosy:
+ David Ellis messages: + msg301192 |
| 2017-09-01 19:48:23 | lukasz.langa | set | messages: + msg301149 |
| 2017-08-31 12:01:28 | cryvate | set | nosy:
+ cryvate |
| 2017-08-30 15:32:59 | r.david.murray | set | nosy:
+ lukasz.langa |
| 2017-08-30 14:15:47 | vxgmichel | create | |