A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2016-April/144013.html below:

[Python-Dev] Pathlib enhancements - acceptable inputs and outputs for __fspath__ and os.fspath()

[Python-Dev] Pathlib enhancements - acceptable inputs and outputs for __fspath__ and os.fspath()Ethan Furman ethan at stoneleaf.us
Tue Apr 12 12:15:34 EDT 2016
On 04/11/2016 04:43 PM, Victor Stinner wrote:
> Le 11 avr. 2016 11:11 PM, "Ethan Furman" a écrit :

>> So my concern in such a case is what happens if we pass this SE
>> string somewhere else: a UTF-8 file, or over a socket, or into a
>> database? Does this have issues that we wouldn't face if we just used bytes?
>
> "SE string" are returned by os.listdir(str), os.walk(str),
> os.getenv(str), sys.argv[int], ... since Python 3.3. Nothing new under
> the sun.

So when we pass a bytes object in, Python (on posix) converts that to a 
string using surrogateescape, gets back strings from the os, and encodes 
them back to bytes, again using surrogateescape?


> Trying to encode a surrogate to ascii, latin1 or utf8 raise an encoding
> error.

latin1?  I thought latin1 had a code point for 0-255, so how could using 
it raise an encoding error?

--
~Ethan~
More information about the Python-Dev mailing list

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