[Twisted-Python] Python 3: bytes vs. str in twisted.python.filepath
Glyph
glyph at twistedmatrix.com
Sun Sep 15 14:48:25 MDT 2013
On Sep 11, 2013, at 10:48 AM, Zooko Wilcox-OHearn <zooko at leastauthority.com> wrote:
> We can instead *require*
> the user to supply a type with the bytestring originally, and then
> remember the type that the user supplied. This breaks only a few use
> cases that are probably very rare, and in fact might be unfixable
> anyway
Just to be specific about this, the use-case that it breaks is the notion that you have a USB key formatted on a Linux machine in KOI-8 and you plug it into a system where the host encoding is Shift-JIS. You can then have a path which is partially in one encoding and partially in another.
The problem with the "bytes-with-encoding" idea is that it doesn't apply to paths, it applies to path segments - which is why FilePath is (well, ought to be) a data *structure*, and not just some methods around existing data (a string).
-glyph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20130915/0abaa9aa/attachment-0002.html>
More information about the Twisted-Python
mailing list