Author progoth
Date 2003-05-15.16:06:09
SpamBayes Score
Marked as misclassified
I'm attaching a zip file containing a python file and
directory structure to test this.

I ran into this bug in real life work, so, as contrived
as the bug test may look, it happens.

I was writing a function which recurses through
directories and does stuff with the files it finds.

glob.glob() doesn't return any files inside a directory
named [_]

glob.glob() crashes on a directory named [A--_B].  I
tried a few different combinations of characters inside
brackets, but this was the only one I could get it to
crash on.

the crash happens during the regular expression
compilation, as probably can be surmised by seeing the
characters which cause it ( [] ).  it also may be a
combination of that and using \ as the directory
delimiter since this is win32.

  File "C:\temp\globbug\", line 5, in test
    fs = glob.glob( path + '\\*' )
  File "C:\Python22\lib\", line 24, in glob
    list = glob(dirname)
  File "C:\Python22\lib\", line 37, in glob
    sublist = glob1(dirname, basename)
  File "C:\Python22\lib\", line 50, in glob1
    return fnmatch.filter(names,pattern)
  File "C:\Python22\lib\", line 47, in filter
    _cache[pat] = re.compile(res)
  File "C:\Python22\lib\", line 179, in compile
    return _compile(pattern, flags)
  File "C:\Python22\lib\", line 229, in _compile
    raise error, v # invalid expression
sre_constants.error: bad character range
Date User Action Args
2007-08-23 14:13:20adminlinkissue738361 messages
2007-08-23 14:13:20admincreate