Sorry, I've forgot to use "Reply All". On Tue, Apr 12, 2016 at 9:49 AM, INADA Naoki <songofacandy at gmail.com> wrote: > IHMO it's safer to get an encoding error rather than no error when you >> concatenate two byte strings encoded to two different encodings (mojibake). >> >> print(os.fspath(obj)) will more likely do what you expect if os.fspath() >> always return str. I mean that it will encode your filename to the encoding >> of the terminal which can be different than the filesystem encoding. >> >> If fspath() can return bytes, you should write >> print(os.fsdecode(os.fspath(obj))). >> >> > Why not print(obj)? > 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. > > -- > INADA Naoki <songofacandy at gmail.com> > -- INADA Naoki <songofacandy at gmail.com> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20160412/871917bd/attachment.html>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4