[Python-checkins] r51745 - python/trunk/Lib/pdb.py

andrew.kuchling python-checkins at python.org
Tue Sep 5 15:19:18 CEST 2006


Author: andrew.kuchling
Date: Tue Sep  5 15:19:18 2006
New Revision: 51745

Modified:
   python/trunk/Lib/pdb.py
Log:
[Bug #1526834] Fix crash in pdb when you do 'b f(';
the function name was placed into a regex pattern and the unbalanced paren
caused re.compile() to report an error

Modified: python/trunk/Lib/pdb.py
==============================================================================
--- python/trunk/Lib/pdb.py	(original)
+++ python/trunk/Lib/pdb.py	Tue Sep  5 15:19:18 2006
@@ -23,7 +23,7 @@
            "post_mortem", "help"]
 
 def find_function(funcname, filename):
-    cre = re.compile(r'def\s+%s\s*[(]' % funcname)
+    cre = re.compile(r'def\s+%s\s*[(]' % re.escape(funcname))
     try:
         fp = open(filename)
     except IOError:


More information about the Python-checkins mailing list