You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
io.open_code should accept PathLike objects #83904
Currently io.open_code (added in Python 3.8) only accepts str arguments. As per PEP-519, it should probably also accept PathLike. It might be worth extending it to accept bytes as well, both for convenience and because documentation claims it should be interchangeable with open(path, 'rb').
Activity
hauntsaninja commentedon Feb 22, 2020
Currently io.open_code (added in Python 3.8) only accepts str arguments. As per PEP-519, it should probably also accept PathLike. It might be worth extending it to accept bytes as well, both for convenience and because documentation claims it should be interchangeable with
open(path, 'rb').https://github.com/python/cpython/blob/3.8/Modules/_io/_iomodule.c#L510
tirkarthi commentedon Feb 22, 2020
This seems to be a duplicate of https://bugs.python.org/issue39691
zooba commentedon Feb 23, 2020
Dup of bpo-39691
As per PEP-578, open_code only accepts an absolute path as a str. The other issue will be used to update the docstring.