[issue25584] a recursive glob pattern fails to list files in the current directory

2015-11-10 Thread Xavier de Gaye
Xavier de Gaye added the comment: New issue 25596 entered: regular files handled as directories in the glob module. Thanks for fixing this Serhiy. -- ___ Python tracker ___ ___

[issue25584] a recursive glob pattern fails to list files in the current directory

2015-11-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Please open new issue for glob() optimization Xavier. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker _

[issue25584] a recursive glob pattern fails to list files in the current directory

2015-11-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4532c4f37429 by Serhiy Storchaka in branch '3.5': Issue #25584: Fixed recursive glob() with patterns starting with '**'. https://hg.python.org/cpython/rev/4532c4f37429 New changeset 175cd763de57 by Serhiy Storchaka in branch 'default': Issue #25584:

[issue25584] a recursive glob pattern fails to list files in the current directory

2015-11-09 Thread Xavier de Gaye
Xavier de Gaye added the comment: glob('invalid_dir/**', recursive=True) triggers the assert that was added by my patch in _rlistdir(). This new patch fixes this: when there is no magic character in the dirname part of a split(), and dirname is not an existing directory, then there is nothing

[issue25584] a recursive glob pattern fails to list files in the current directory

2015-11-09 Thread Xavier de Gaye
Xavier de Gaye added the comment: FWIW the patch looks good to me. I find the code in glob.py difficult to read as it happily joins regular filenames together with os.path.join() or attempts to list the files contained into a regular file (sic). The attached diff makes the code more correct a

[issue25584] a recursive glob pattern fails to list files in the current directory

2015-11-09 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file40987/rglob_zero_dirs_2.patch ___ Python tracker ___ ___ Python-bugs-list

[issue25584] a recursive glob pattern fails to list files in the current directory

2015-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Likely it was implementation artifact. Current implementation is simpler butter fitted existing glob design. The problem was that '**/a' should list 'a' and 'd/a', but '**/' should list only 'd/', and not ''. Here is a patch that makes '**' to match also zer

[issue25584] a recursive glob pattern fails to list files in the current directory

2015-11-08 Thread R. David Murray
R. David Murray added the comment: Ah, I see, 'pattern' there means the whole pattern. That certainly isn't clear. -- ___ Python tracker ___

[issue25584] a recursive glob pattern fails to list files in the current directory

2015-11-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I already don't remember if it was a deliberate design, or just implementation detail. In any case it is not documented. > I believe this behavior matches the documentation: No, it is not related. It is that './**/' will list only directories, not regular f

[issue25584] a recursive glob pattern fails to list files in the current directory

2015-11-08 Thread R. David Murray
R. David Murray added the comment: I believe this behavior matches the documentation: "If the pattern is followed by an os.sep, only directories and subdirectories match." ('the pattern' being '**') I wonder if '***.pacnew' would work. -- nosy: +pitrou, r.david.murray

[issue25584] a recursive glob pattern fails to list files in the current directory

2015-11-08 Thread Xavier de Gaye
New submission from Xavier de Gaye: On archlinux during an upgrade, the package manager backups some files in /etc with a .pacnew extension. On my system there are 20 such files, 9 .pacnew files located in /etc and 11 .pacnew files in subdirectories of /etc. The following commands are run from