[Python-Dev] Pathlib enhancements - acceptable inputs and outputs for fspath and os.fspath() (original) (raw)
Stephen J. Turnbull stephen at xemacs.org
Tue Apr 12 03:52:19 EDT 2016
- Previous message (by thread): [Python-Dev] Pathlib enhancements - acceptable inputs and outputs for __fspath__ and os.fspath()
- Next message (by thread): [Python-Dev] Pathlib enhancements - acceptable inputs and outputs for __fspath__ and os.fspath()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
INADA Naoki writes:
Why not print(obj)?
print(obj) will give mojibake by default if sys.getfilenameencoding() != sys.getdefaultencoding().
str() is normal high-level API, and fspath and os.fspath() should be low level API. Normal users shouldn't use fspath and os.fspath(). Only library developers should use it.
This is the price we pay for the stubbornness of the bytes-are-text-too meme.
- Previous message (by thread): [Python-Dev] Pathlib enhancements - acceptable inputs and outputs for __fspath__ and os.fspath()
- Next message (by thread): [Python-Dev] Pathlib enhancements - acceptable inputs and outputs for __fspath__ and os.fspath()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]