diff -r 7c9327ff5de6 Lib/glob.py --- a/Lib/glob.py Sat Dec 15 22:36:49 2012 +0100 +++ b/Lib/glob.py Sun Dec 16 11:02:46 2012 +0200 @@ -28,7 +28,10 @@ if not dirname: yield from glob1(None, basename) return - if has_magic(dirname): + # `os.path.split()` returns the argument itself as a dirname if it is a + # drive or UNC path. Prevent an infinite recursion if a drive or UNC path + # contains magic characters (i.e. r'\\?\C:'). + if dirname != pathname and has_magic(dirname): dirs = iglob(dirname) else: dirs = [dirname]