[Python-Dev] Bytes path support

2014-08-19 Thread Serhiy Storchaka
Builting open(), io classes, os and os.path functions and some other functions in the stdlib support bytes paths as well as str paths. But many functions doesn't. There are requests about adding this support ([1], [2]) in some modules. It is easy (just call os.fsdecode() on argument) but I'm

Re: [Python-Dev] Fwd: PEP 467: Minor API improvements for bytes bytearray

2014-08-19 Thread Nick Coghlan
On 18 August 2014 10:45, Guido van Rossum gu...@python.org wrote: On Sun, Aug 17, 2014 at 5:22 PM, Barry Warsaw ba...@python.org wrote: On Aug 18, 2014, at 10:08 AM, Nick Coghlan wrote: There's actually another aspect to your idea, independent of the naming: exposing a view rather than just

Re: [Python-Dev] Fwd: PEP 467: Minor API improvements for bytes bytearray

2014-08-19 Thread Guido van Rossum
On Tue, Aug 19, 2014 at 5:25 AM, Nick Coghlan ncogh...@gmail.com wrote: On 18 August 2014 10:45, Guido van Rossum gu...@python.org wrote: On Sun, Aug 17, 2014 at 5:22 PM, Barry Warsaw ba...@python.org wrote: On Aug 18, 2014, at 10:08 AM, Nick Coghlan wrote: There's actually another

Re: [Python-Dev] Bytes path support

2014-08-19 Thread Guido van Rossum
The official policy is that we want them to go away, but reality so far has not budged. We will continue to hold our breath though. :-) On Tue, Aug 19, 2014 at 1:37 AM, Serhiy Storchaka storch...@gmail.com wrote: Builting open(), io classes, os and os.path functions and some other functions

Re: [Python-Dev] Bytes path support

2014-08-19 Thread Ben Hoyt
The official policy is that we want them [support for bytes paths in stdlib functions] to go away, but reality so far has not budged. We will continue to hold our breath though. :-) Does that mean that new APIs should explicitly not support bytes? I'm thinking of os.scandir() (PEP 471),

Re: [Python-Dev] Bytes path support

2014-08-19 Thread Serhiy Storchaka
19.08.14 20:02, Guido van Rossum написав(ла): The official policy is that we want them to go away, but reality so far has not budged. We will continue to hold our breath though. :-) Does it mean that we should reject all propositions about adding bytes path support in existing functions (in

Re: [Python-Dev] Bytes path support

2014-08-19 Thread Benjamin Peterson
On Tue, Aug 19, 2014, at 10:31, Ben Hoyt wrote: The official policy is that we want them [support for bytes paths in stdlib functions] to go away, but reality so far has not budged. We will continue to hold our breath though. :-) Does that mean that new APIs should explicitly not

Re: [Python-Dev] Bytes path support

2014-08-19 Thread Ben Hoyt
The official policy is that we want them [support for bytes paths in stdlib functions] to go away, but reality so far has not budged. We will continue to hold our breath though. :-) Does that mean that new APIs should explicitly not support bytes? I'm thinking of os.scandir() (PEP 471),

Re: [Python-Dev] Bytes path support

2014-08-19 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/19/2014 01:43 PM, Ben Hoyt wrote: The official policy is that we want them [support for bytes paths in stdlib functions] to go away, but reality so far has not budged. We will continue to hold our breath though. :-) Does that mean that new

Re: [Python-Dev] Bytes path support

2014-08-19 Thread Benjamin Peterson
On Tue, Aug 19, 2014, at 10:43, Ben Hoyt wrote: The official policy is that we want them [support for bytes paths in stdlib functions] to go away, but reality so far has not budged. We will continue to hold our breath though. :-) Does that mean that new APIs should explicitly not

Re: [Python-Dev] Bytes path support

2014-08-19 Thread Antoine Pitrou
Le 19/08/2014 13:43, Ben Hoyt a écrit : The official policy is that we want them [support for bytes paths in stdlib functions] to go away, but reality so far has not budged. We will continue to hold our breath though. :-) Does that mean that new APIs should explicitly not support bytes? I'm

Re: [Python-Dev] Bytes path support

2014-08-19 Thread Marko Rauhamaa
Tres Seaver tsea...@palladion.com: On 08/19/2014 01:43 PM, Ben Hoyt wrote: Fair enough. I don't quite understand, though -- why is the official policy to kill something that's essential on *nix? ISTM that the policy is based on a fantasy that it looks like text to me in my use cases, so

Re: [Python-Dev] Bytes path support

2014-08-19 Thread Stephen J. Turnbull
Ben Hoyt writes: Fair enough. I don't quite understand, though -- why is the official policy to kill something that's essential on *nix? They're not essential on *nix. Unix paths at the OS level are just bytes (even on Mac, although the most common Mac filesystem does enforce UTF-8 Unicode

Re: [Python-Dev] Bytes path support

2014-08-19 Thread Greg Ewing
Ben Hoyt wrote: Does that mean that new APIs should explicitly not support bytes? ... Bytes paths are essentially broken on Windows. But on Unix, paths are essentially bytes. What's the official policy for dealing with that? -- Greg ___ Python-Dev

Re: [Python-Dev] Bytes path support

2014-08-19 Thread Greg Ewing
Stephen J. Turnbull wrote: This case can be handled now using the surrogateescape error handler, So maybe the way to make bytes paths go away is to always use surrogateescape for paths on unix? -- Greg ___ Python-Dev mailing list

Re: [Python-Dev] Bytes path support

2014-08-19 Thread Guido van Rossum
I'm sorry my moment of levity was taken so seriously. With my serious hat on, I would like to claim that *conceptually* filenames are most definitely text. Due to various historical accidents the UNIX system calls often encoded text as arguments, and we sometimes need to control that encoding.

Re: [Python-Dev] Bytes path support

2014-08-19 Thread Stephen J. Turnbull
Greg Ewing writes: Stephen J. Turnbull wrote: This case can be handled now using the surrogateescape error handler, So maybe the way to make bytes paths go away is to always use surrogateescape for paths on unix? Backward compatibility rules that out, I think. I certainly would

Re: [Python-Dev] Bytes path support

2014-08-19 Thread Guido van Rossum
On Tuesday, August 19, 2014, Stephen J. Turnbull step...@xemacs.org wrote: Greg Ewing writes: Stephen J. Turnbull wrote: This case can be handled now using the surrogateescape error handler, So maybe the way to make bytes paths go away is to always use surrogateescape for

Re: [Python-Dev] Bytes path support

2014-08-19 Thread Marko Rauhamaa
Guido van Rossum gu...@python.org: With my serious hat on, I would like to claim that *conceptually* filenames are most definitely text. Due to various historical accidents the UNIX system calls often encoded text as arguments, and we sometimes need to control that encoding. Due to