[issue33275] glob.glob should explicitly note that results aren't sorted

2018-11-04 Thread Julien Palard
Change by Julien Palard : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue33275] glob.glob should explicitly note that results aren't sorted

2018-05-02 Thread Eryk Sun
Eryk Sun added the comment: FAT inserts a new file entry in a directory at the first available position. (If it's a long filename, this could be up to 21 contiguous dirents for a combined long/short dirent set.) This means a directory listing is usually in the same order

[issue33275] glob.glob should explicitly note that results aren't sorted

2018-05-02 Thread Ben FrantzDale
Ben FrantzDale added the comment: I looked into it a bit more. With python 2.7 on macOS High Sierra on APFS (Encrypted) with a FAT32 thumb drive... I have a directory that glob.glob('/Volumes/thumb/tmp/*') shows as sorted. I cp -r that to /tmp with bash.

[issue33275] glob.glob should explicitly note that results aren't sorted

2018-04-25 Thread Eryk Sun
Eryk Sun added the comment: As I said, some file systems such as NTFS and ISO 9660 (or Joliet) store directories in lexicographically sorted order. NTFS does this using a b-tree and case-insensitive comparison, which helps the driver efficiently implement filtering a

[issue33275] glob.glob should explicitly note that results aren't sorted

2018-04-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: I agree that anything that has the same FS-determined sorted or not behavior should get the same note, for the same reason. Ben, can you test? Eryk, can you enlighten us further? PS: Ben, when responding by email, please delete the quote,

[issue33275] glob.glob should explicitly note that results aren't sorted

2018-04-24 Thread Ben FrantzDale
Ben FrantzDale added the comment: Great point. Looks like the phrase is "in arbitrary order" in the docs for those (both 2.7 and 3), which is better than saying nothing. I'd still prefer a bit more specificity about the potential gotcha since "arbitrary" seems a lot less

[issue33275] glob.glob should explicitly note that results aren't sorted

2018-04-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Are there such notes in the descriptions of os.listdir(), os.scandir(), os.walk(), os.fwalk() and corresponding Path methods? If explicitly document the sorting, this should be made for all files enumerating functions.

[issue33275] glob.glob should explicitly note that results aren't sorted

2018-04-24 Thread Elena Oat
Change by Elena Oat : -- keywords: +patch pull_requests: +6287 stage: needs patch -> patch review ___ Python tracker ___

[issue33275] glob.glob should explicitly note that results aren't sorted

2018-04-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: How about adding a sentence to the end of the first paragraph. glob.glob(pathname, *, recursive=False) Return a possibly-empty list of path names that match pathname, which must be a string containing a path specification. pathname can

[issue33275] glob.glob should explicitly note that results aren't sorted

2018-04-13 Thread Ben FrantzDale
Ben FrantzDale added the comment: Fascinating. That seems like an even wilder gotcha: It sounds like a script assuming sorted results would work in one directory (on one filesystem) but not on another. Or even weirder, if I had a mounted scratch partition, the script could

[issue33275] glob.glob should explicitly note that results aren't sorted

2018-04-13 Thread Eryk Sun
Eryk Sun added the comment: > The sortedness of glob.glob's output is platform-dependent. It's typically file-system dependent (e.g. NTFS, FAT, ISO9660, UDF) -- at least on Windows. NTFS and ISO9660 store directories in sorted order based on the filename (Unicode or ASCII

[issue33275] glob.glob should explicitly note that results aren't sorted

2018-04-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: This seems reasonable. I would like like it to be part of the regular text rather rather than appearing as a big ..note entry which can be visually distracting from the core functionality. -- assignee: -> docs@python

[issue33275] glob.glob should explicitly note that results aren't sorted

2018-04-13 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +csabella ___ Python tracker ___ ___

[issue33275] glob.glob should explicitly note that results aren't sorted

2018-04-13 Thread Ben FrantzDale
New submission from Ben FrantzDale : The sortedness of glob.glob's output is platform-dependent. While the docs do not mention sorting, and so are strictly correct, if you are on a platform where its output is sorted, it's easy to believe that the output is always sorted.