On 9 April 2016 at 23:02, R. David Murray wrote:
That is, a 'filename' is the identifier we've assigned to this thing
pointed to by an inode in linux, but an os path is a text representation
of the path from the root filename to a specified filename. That is,
the path *is* the name, so to say
On 10 April 2016 at 15:58, Greg Ewing wrote:
> Brett Cannon wrote:
>
>> Depends if you use `/` or `\` as your path separator
>
>
> Or whether your pathnames look entirely different, e.g VMS:
>
> device:[topdir.subdir.subsubdir]filename.ext;version
>
> Pathnames are very much OS-dependent in both
Eric Snow wrote:
All this matters because it impacts the value returned from
__ospath__(). Should it return the string representation of the path
for the current OS or some standardized representation?
What standardized representation? I'm not aware of such
a thing.
I'd expect
the former. H
Nick Coghlan wrote:
We want to be able to readily use the protocol helper in builtin
modules like os and low level Python modules like os.path, which means
we want it to be much lower down in the import hierarchy than pathlib.
Also, it's more general than that. It works on any
object that wants
Brett Cannon wrote:
Depends if you use `/` or `\` as your path separator
Or whether your pathnames look entirely different, e.g VMS:
device:[topdir.subdir.subsubdir]filename.ext;version
Pathnames are very much OS-dependent in both syntax *and* semantics.
Even the main two in use today (un
On 10 April 2016 at 02:41, Ethan Furman wrote:
> If we add os.fspath(), but don't allow bytes to be returned from it, our
> above example looks more like:
>
> if isinstance(a_path_thingy, bytes):
> # because os can accept bytes
> pass
> else:
> a_path_thingy = os.fspath(a_pat
I've just spotted this email from Guido, sorry about the delay in
responding.
Further comments below.
On Thu, Jan 14, 2016 at 10:47:09AM -0800, Guido van Rossum wrote:
> I think the discussion petered out and nobody asked me to approve it yet
> (or I lost track of it). I'm almost happy to appr
On 9 April 2016 at 23:02, R. David Murray wrote:
> That is, a 'filename' is the identifier we've assigned to this thing
> pointed to by an inode in linux, but an os path is a text representation
> of the path from the root filename to a specified filename. That is,
> the path *is* the name, so to
On 9 April 2016 at 22:43, Victor Stinner wrote:
> Please don't loose time trying yet another sandbox inside CPython. It's just
> a waste of time. It's broken by design.
>
> Please read my email about my attempt (pysandbox):
> https://lwn.net/Articles/574323/
>
> And the LWN article:
> https://lwn.
Excellent. Issue/patch here:
http://bugs.python.org/issue26726
On 2016年04月09日 08時16分, Guido van Rossum wrote:
OK, so this should be taken to the bug tracker.
On Saturday, April 9, 2016, Grady Martin wrote:
I agree. However, an incorrect choice for an argument with a choices
parameter res
On 04/09/2016 12:48 AM, Nick Coghlan wrote:
> Considering the helper function usage, here's some examples in
> combination with os.fsencode and os.fsdecode:
>
> # Status quo for binary/text path conversions
> text_path = os.fsdecode(bytes_path)
> bytes_path = os.fsencode(text_path)
>
> #
On 04/09/2016 07:32 AM, Nikolaus Rath wrote:
On Apr 07 2016, Donald Stufft wrote:
On Apr 7, 2016, at 6:48 AM, Nikolaus Rath wrote:
Does anyone anticipate any classes other than those from pathlib to come
with such a method?
It seems like it would be reasonable for pathlib.Path to call fspa
On 04/09/2016 03:51 AM, Koos Zevenhoven wrote:
On Sat, Apr 9, 2016 at 10:16 AM, Ethan Furman wrote:
3.5.0 scandir supports bytes:
Maybe it's the bytes support in scandir that should be deprecated?
(And not bytes support in general, which cannot be done on posix, as I
hear Stephen T. will te
OK, so this should be taken to the bug tracker.
On Saturday, April 9, 2016, Grady Martin wrote:
> I agree. However, an incorrect choice for an argument with a choices
> parameter results in this string.
>
> On 2016年04月08日 18時12分, Guido van Rossum wrote:
>
>>
>> That string looks like it is aime
On Apr 07 2016, Donald Stufft wrote:
>> On Apr 7, 2016, at 6:48 AM, Nikolaus Rath wrote:
>>
>> Does anyone anticipate any classes other than those from pathlib to come
>> with such a method?
>
>
> It seems like it would be reasonable for pathlib.Path to call fspath on the
> path passed to pathli
On Sat, 09 Apr 2016 17:48:38 +1000, Nick Coghlan wrote:
> On 9 April 2016 at 04:25, Brett Cannon wrote:
> > On Fri, 8 Apr 2016 at 11:13 Ethan Furman wrote:
> >> On 04/08/2016 10:46 AM, Koos Zevenhoven wrote:
> >> > On Fri, Apr 8, 2016 at 7:42 PM, Chris Barker wrote:
> >> >> On Fri, Apr 8, 201
I'm with Victor here. In fact I tried (and failed) to convince Victor
that the approach is entirely unworkable when he was starting, don't
be the next one :-)
On Sat, Apr 9, 2016 at 3:43 PM, Victor Stinner wrote:
> Please don't loose time trying yet another sandbox inside CPython. It's just
> a w
Please don't loose time trying yet another sandbox inside CPython. It's
just a waste of time. It's broken by design.
Please read my email about my attempt (pysandbox):
https://lwn.net/Articles/574323/
And the LWN article:
https://lwn.net/Articles/574215/
There are a lot of safe ways to run CPyth
On Sat, Apr 9, 2016 at 10:16 AM, Ethan Furman wrote:
> On 04/09/2016 12:07 AM, Victor Stinner wrote:
>>
>> os.DirEntry doesn't support bytes: os.scandir() only accept str. It's a
>> deliberate choice.
>
>
> 3.5.0 scandir supports bytes:
>
> --> huh = list(scandir(b'.'))
> --> huh
> [, , b'__MACOS
On Fri, Apr 8, 2016 at 9:09 PM, Chris Angelico wrote:
> On Sat, Apr 9, 2016 at 5:03 AM, Chris Barker
> wrote:
> > On Fri, Apr 8, 2016 at 11:34 AM, Koos Zevenhoven
> wrote:
> >>
> >> >
> >> > __pathstr__ # pathstring
> >> >
> >>
> >> Or perhaps __pathstring__ in case it may be or return byte str
2016-04-09 9:52 GMT+02:00 Victor Stinner :
> But the hash is used as an heuristic to decide if a string is "immutable" or
> not, the refcount is also used by the heuristic. If the string is immutable,
> an operation like resize must create a new string.
I'm talking about this private function:
st
On 09.04.16 10:52, Victor Stinner wrote:
Le 9 avr. 2016 03:04, "Larry Hastings" mailto:la...@hastings.org>> a écrit :
> Although the str object is immutable from Python's perspective, the C
object itself is mutable. For example, for dynamically-created strings
the hash field may be lazy-compute
I agree. However, an incorrect choice for an argument with a choices parameter
results in this string.
On 2016年04月08日 18時12分, Guido van Rossum wrote:
That string looks like it is aimed at the developer, not the user of
the program, so it makes sense not to translate it.
On Fri, Apr 8, 2016 a
Le 9 avr. 2016 03:04, "Larry Hastings" a écrit :
> Although the str object is immutable from Python's perspective, the C
object itself is mutable. For example, for dynamically-created strings the
hash field may be lazy-computed and cached inside the object.
Yes, the hash is computed once on dema
On 9 April 2016 at 04:25, Brett Cannon wrote:
> On Fri, 8 Apr 2016 at 11:13 Ethan Furman wrote:
>> On 04/08/2016 10:46 AM, Koos Zevenhoven wrote:
>> > On Fri, Apr 8, 2016 at 7:42 PM, Chris Barker wrote:
>> >> On Fri, Apr 8, 2016 at 9:02 AM, Koos Zevenhoven wrote:
>>
>> >>> I'm still thinking
On 9 April 2016 at 10:56, Larry Hastings wrote:
>
>
> I have a straightforward question about the str object, specifically the
> PyUnicodeObject. I've tried reading the source to answer the question
> myself but it's nearly impenetrable. So I was hoping someone here who
> understands the current
On 04/09/2016 12:07 AM, Victor Stinner wrote:
os.DirEntry doesn't support bytes: os.scandir() only accept str. It's a
deliberate choice.
3.5.0 scandir supports bytes:
--> huh = list(scandir(b'.'))
--> huh
[, , b'__MACOSX'>, , , b'index.html'>]
--> huh[0].path
b'./minicourse-ajax-project'
--
os.DirEntry doesn't support bytes: os.scandir() only accept str. It's a
deliberate choice.
I strongly suggest to only support Unicode for filenames in Python 3. So
__fspath__ must only return str, or a TypeError must be raised.
Victor
___
Python-Dev mai
On 9 April 2016 at 02:02, Koos Zevenhoven wrote:
> I'm still thinking a little bit about 'pathname', which to me sounds
> more like a string than fspath does [1]. It would be nice to have the
> string/path distinction especially when pathlib adoption grows larger.
> But who knows, maybe somewhere
29 matches
Mail list logo