[New-bugs-announce] [issue25584] a recursive glob pattern fails to list files in the current directory

Xavier de Gaye report at bugs.python.org
Sun Nov 8 10:54:35 EST 2015


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 /etc:

    $ shopt -s globstar
    $ ls **/*.pacnew | wc -w
    20
    $ ls *.pacnew | wc -w
    9

With python:

    $ python
    Python 3.6.0a0 (default:72cca30f4707, Nov  2 2015, 14:17:31) 
    [GCC 5.2.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import glob
    >>> len(glob.glob('./**/*.pacnew', recursive=True))
    20
    >>> len(glob.glob('*.pacnew'))
    9
    >>> len(glob.glob('**/*.pacnew', recursive=True))
    11

The '**/*.pacnew' pattern does not list the files in /etc, only those located in the subdirectories of /etc.

----------
components: Library (Lib)
messages: 254344
nosy: serhiy.storchaka, xdegaye
priority: normal
severity: normal
status: open
title: a recursive glob pattern fails to list files in the current directory
type: behavior
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25584>
_______________________________________


More information about the New-bugs-announce mailing list