]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fixing #409651 -- \ in a character group
authorMoshe Zadka <moshez@math.huji.ac.il>
Fri, 30 Mar 2001 15:37:31 +0000 (15:37 +0000)
committerMoshe Zadka <moshez@math.huji.ac.il>
Fri, 30 Mar 2001 15:37:31 +0000 (15:37 +0000)
Lib/fnmatch.py
Misc/NEWS

index 75d2d6eb43b49514f739eb8e74353bb7f5400ed3..fd51e259e736ab459ac070dee774fb0eeff7ba11 100644 (file)
@@ -73,7 +73,7 @@ def translate(pat):
                        if j >= n:
                                res = res + '\\['
                        else:
-                               stuff = pat[i:j]
+                               stuff = pat[i:j].replace('\\','\\\\')
                                i = j+1
                                if stuff[0] == '!':
                                        stuff = '[^' + stuff[1:] + ']'
index c9348c21465973ba3e2f3ed3c2071e4d8501ec62..78fe57c94d21da563990e9e712425e964b95a258 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -26,6 +26,8 @@ http://sourceforge.net/tracker/index.php?func=detail&aid=<id>&group_id=5470&atid
 - In Lib/locale.py, setlocale emulation, use != and not is not to compare
   strings
 
+- #409651 - in Lib/fnmatch.py, make \ in a character group work
+
 
 What's New in Python 2.0?
 =========================