[docs] Documentation bug in glob examples

Ewan Higgs ewan_higgs at yahoo.co.uk
Wed Oct 5 17:04:50 CEST 2011


Sir/Madame,
I believe there is a bug in the documentation for the glob module accessed through the following url on 2011/10/05:
http://docs.python.org/library/glob.html


Currently the example demonstrates the output of a series of globbing patterns in a directory with files 1.gif, 2.gif, and card.gif. The results returned are incorrect. They read:


>>> import glob 
>>> glob.glob('./[0-9].*') 
['./1.gif', './2.txt'] 
>>> glob.glob('*.gif') 
['1.gif', 'card.gif'] 
>>> glob.glob('?.gif') 
['1.gif']


However, the results should be as follows:

$python
Python 2.6.5 (r265:79063, Apr 26 2010, 12:52:32) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import glob
>>> glob.glob('./[0-9].gif')
['./1.gif', './2.gif']
>>> glob.glob('*.gif')
['1.gif', 'card.gif', '2.gif']
>>> glob.glob('?.gif')
['1.gif', '2.gif']
>>> 

Yours,
Ewan Higgs

NB: This email was written based on advice found here:
http://docs.python.org/bugs.html



More information about the docs mailing list