Re: [Python-Dev] Bytes path support

2014-08-20 Thread Stephen J. Turnbull
Guido van Rossum writes: On Tuesday, August 19, 2014, Stephen J. Turnbull step...@xemacs.org wrote: Greg Ewing writes: 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

Re: [Python-Dev] Bytes path support

2014-08-20 Thread Stephen J. Turnbull
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. ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] Bytes path support

2014-08-20 Thread Ben Finney
Stephen J. Turnbull step...@xemacs.org 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 -- \“Intellectual property is to the 21st century

Re: [Python-Dev] Bytes path support

2014-08-20 Thread Paul Moore
On 20 August 2014 07:53, Ben Finney ben+pyt...@benfinney.id.au wrote: Stephen J. Turnbull step...@xemacs.org 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.

Re: [Python-Dev] Bytes path support

2014-08-20 Thread Nick Coghlan
On 20 Aug 2014 04:18, Marko Rauhamaa ma...@pacujo.net wrote: 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

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,

Re: [Python-Dev] Bytes path support

2014-08-20 Thread Brett Cannon
On Wed Aug 20 2014 at 9:02:25 AM Antoine Pitrou anto...@python.org 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

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

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

Re: [Python-Dev] Bytes path support

2014-08-20 Thread Nick Coghlan
On 21 Aug 2014 08:19, Greg Ewing 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 problem with scandir() in particular is that there is

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 other

Re: [Python-Dev] Bytes path support

2014-08-20 Thread Nick Coghlan
On 21 Aug 2014 09:06, Chris Barker chris.bar...@noaa.gov 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.

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 greg.ew...@canterbury.ac.nz 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

Re: [Python-Dev] Bytes path support

2014-08-20 Thread Nick Coghlan
On 21 August 2014 09:33, Ethan Furman et...@stoneleaf.us wrote: On 08/20/2014 03:31 PM, Nick Coghlan wrote: On 21 Aug 2014 08:19, Greg Ewing greg.ew...@canterbury.ac.nz mailto:greg.ew...@canterbury.ac.nz wrote: Antoine Pitrou wrote: I think if you want low-level features (such as

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 et...@stoneleaf.us 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

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 ba...@python.org 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

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 (not

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

Re: [Python-Dev] Bytes path support

2014-08-20 Thread Cameron Simpson
On 20Aug2014 16:04, Chris Barker - NOAA Federal chris.bar...@noaa.gov 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