Serhiy Storchaka added the comment:
Low level functions inthe os module support both str and bytes paths (they
support also path-like objects and often support open file descriptors). But
high level functions support only str and maybe path-like objects. Use
os.fsdecode if you need to conver
John Goerzen added the comment:
As has been pointed out to me, the surrogateescape method could be used here;
however, it is a bit of an odd duckling itself, and the system's open() call
accepts bytes; couldn't this as well?
--
___
Python tracker
New submission from John Goerzen :
This simple recipe fails:
>>> import dbm
>>> dbm.open(b"foo")
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python3.7/dbm/__init__.py", line 78, in open
result = whichdb(file) if 'n' not in flag else None
File "/usr/lib/pytho