Movatterモバイル変換


[0]ホーム

URL:


homepage

Message286585

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Authoreryksun
Recipientseryksun, paul.moore, steve.dower, tim.golden, zach.ware
Date2017-02-01.03:06:19
SpamBayes Score-1.0
Marked as misclassifiedYes
Message-id<1485918380.71.0.564330613462.issue29409@psf.upfronthosting.co.za>
In-reply-to
Content
PEP 529 isn't implemented for io.FileIO, and I think it should be. If a UTF-8 path is passed to open(), it ends up calling C _open instead of decoding the path and calling C _wopen. Also, if a pathlike object is passed to io.FileIO, it calls PyUnicode_FSConverter on it, converting it to UTF-8 and then passing it to _open. For example:    >>> p = r'C:\Temp\αβψδ'    >>> os.path.exists(p)    True    >>> open(p.encode())    Traceback (most recent call last):      File "<stdin>", line 1, in <module>    FileNotFoundError: [Errno 2] No such file or directory: b'C:\\Temp\\\xce\xb1\xce\xb2\xcf\x88\xce\xb4'    >>> io.FileIO(pathlib.Path(p))    Traceback (most recent call last):      File "<stdin>", line 1, in <module>    FileNotFoundError: [Errno 2] No such file or directory: WindowsPath('C:/Temp/αβψδ')The Windows implementation should mirror the POSIX implementation via PyUnicode_FSDecoder.
History
DateUserActionArgs
2017-02-01 03:06:20eryksunsetrecipients: +eryksun,paul.moore,tim.golden,zach.ware,steve.dower
2017-02-01 03:06:20eryksunsetmessageid: <1485918380.71.0.564330613462.issue29409@psf.upfronthosting.co.za>
2017-02-01 03:06:20eryksunlinkissue29409 messages
2017-02-01 03:06:19eryksuncreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp