Re: [Python-Dev] Bytes path support

2014-08-20 Thread Cameron Simpson
On 20Aug2014 16:04, Chris Barker - NOAA Federal wrote: but disallowing them in higher level > explicitly cross platform abstractions like pathlib. I think the trick here is that posix-using folks claim that filenames are just bytes, and indeed they can be passed around with a char*, so they

Re: [Python-Dev] Bytes path support

2014-08-20 Thread Stephen J. Turnbull
Nick Coghlan writes: > One idea I had along those lines is a surrogatereplace error handler ( > http://bugs.python.org/issue22016) that emitted an ASCII question mark for > each smuggled byte, rather than propagating the encoding problem. Please, don't. "Smuggled bytes" are not independent ev

Re: [Python-Dev] Bytes path support

2014-08-20 Thread Ben Hoyt
>> If scandir is low-level, and the low-level API's are the ones that should >> support bytes paths, then scandir should support bytes paths. >> >> Is that what you meant to say? > > Yes. The discussions around PEP 471 *deferred* discussions of bytes > and file descriptor support to their own RFEs

Re: [Python-Dev] PEP 4000 to explicitly declare we won't be doing a Py3k style compatibility break again?

2014-08-20 Thread Joseph Martinot-Lagarde
Le 18/08/2014 03:02, Guido van Rossum a écrit : On Sun, Aug 17, 2014 at 6:29 AM, Barry Warsaw mailto:ba...@python.org>> wrote: On Aug 16, 2014, at 07:43 PM, Guido van Rossum wrote: >(Don't understand this to mean that we should never deprecate things. >Deprecations will happen, th

Re: [Python-Dev] Bytes path support

2014-08-20 Thread Ethan Furman
On 08/20/2014 05:15 PM, Nick Coghlan wrote: On 21 August 2014 09:33, Ethan Furman wrote: On 08/20/2014 03:31 PM, Nick Coghlan wrote: scandir is low level (the entire os module is low level). In fact, aside from pathlib, I'd consider pretty much every API we have that deals with paths to be lo

Re: [Python-Dev] Bytes path support

2014-08-20 Thread Nick Coghlan
On 21 August 2014 09:33, Ethan Furman wrote: > On 08/20/2014 03:31 PM, Nick Coghlan wrote: >> On 21 Aug 2014 08:19, "Greg Ewing" > > wrote: >>> >>> >>> Antoine Pitrou wrote: I think if you want low-level features (such as unconverted bytes paths >

Re: [Python-Dev] Bytes path support

2014-08-20 Thread Ethan Furman
On 08/20/2014 03:31 PM, Nick Coghlan wrote: On 21 Aug 2014 08:19, "Greg Ewing" mailto:greg.ew...@canterbury.ac.nz>> wrote: Antoine Pitrou wrote: I think if you want low-level features (such as unconverted bytes paths under POSIX), it is reasonable to point you to low-level APIs. The prob

Re: [Python-Dev] Bytes path support

2014-08-20 Thread Nick Coghlan
On 21 Aug 2014 09:06, "Chris Barker" wrote: > > As I understand it, the whole problem with some posix systems is that there is NO filesystem encoding -- i.e. you can't know for sure what encoding a filename is in. So you need to be able to pass the bytes through as they are. > > (At least as I re

Re: [Python-Dev] Bytes path support

2014-08-20 Thread Chris Barker
> > but disallowing them in higher level >> > explicitly cross platform abstractions like pathlib. >> > I think the trick here is that posix-using folks claim that filenames are just bytes, and indeed they can be passed around with a char*, so they seem to be. but you can't possible do anything o

Re: [Python-Dev] Bytes path support

2014-08-20 Thread Nick Coghlan
On 21 Aug 2014 08:19, "Greg Ewing" wrote: > > Antoine Pitrou wrote: >> >> I think if you want low-level features (such as unconverted bytes paths under POSIX), it is reasonable to point you to low-level APIs. > > > The problem with scandir() in particular is that there is > currently *no* low-leve

Re: [Python-Dev] Bytes path support

2014-08-20 Thread Greg Ewing
Antoine Pitrou wrote: I think if you want low-level features (such as unconverted bytes paths under POSIX), it is reasonable to point you to low-level APIs. The problem with scandir() in particular is that there is currently *no* low-level API exposed that gives the same functionality. If scan

Re: [Python-Dev] Bytes path support

2014-08-20 Thread Terry Reedy
On 8/20/2014 9:01 AM, Antoine Pitrou wrote: Le 20/08/2014 07:08, Nick Coghlan a écrit : It's not just the JVM that says text and binary APIs should be separate - it's every widely used operating system services layer except POSIX. The POSIX way works well *if* everyone reliably encodes things a

Re: [Python-Dev] Bytes path support

2014-08-20 Thread Brett Cannon
On Wed Aug 20 2014 at 9:02:25 AM Antoine Pitrou wrote: > Le 20/08/2014 07:08, Nick Coghlan a écrit : > > > > It's not just the JVM that says text and binary APIs should be separate > > - it's every widely used operating system services layer except POSIX. > > The POSIX way works well *if* everyon

Re: [Python-Dev] Bytes path support

2014-08-20 Thread Antoine Pitrou
Le 20/08/2014 07:08, Nick Coghlan a écrit : It's not just the JVM that says text and binary APIs should be separate - it's every widely used operating system services layer except POSIX. The POSIX way works well *if* everyone reliably encodes things as UTF-8 or always uses encoding detection, bu

Re: [Python-Dev] Bytes path support

2014-08-20 Thread Nick Coghlan
On 20 Aug 2014 04:18, "Marko Rauhamaa" wrote: > > Tres Seaver : > > > 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 tha

Re: [Python-Dev] Bytes path support

2014-08-20 Thread Paul Moore
On 20 August 2014 07:53, Ben Finney wrote: > "Stephen J. Turnbull" writes: > >> Marko Rauhamaa writes: >> > Unix programmers, though, shouldn't be shielded from bytes. >> >> Nobody's trying to do that. But Python users should be shielded from >> Unix programmers. > > +1 QotW That quote is actu