Subject: bug#34489: 25.2; pdb fails if directory contains '++'

From: Stefan Kangas <[email-masked]>
Date: Tue, 2 Jul 2019 21:42:31 +0200

Eli Zaretskii <[email-masked]> writes:

> Hmm... I wonder why the code bothers specifying the allowed characters
> explicitly, and in particular why it only allows ASCII characters.
>
> Does the code work if the directory has non-ASCII characters instead
> of "++"?

No, it breaks.  For now, I've attached a patch to use "[:alnum:]",
which fixes that use case for me.

Regarding your first question, I'm not exactly sure why.  Maybe we
could go as far as just doing "[[:print:]]*" for that part - or
simply ".*".  What do you think?

Thanks,
Stefan Kangas
From 2f671d7e84109af649457cf077ca10e949c5211d Mon Sep 17 00:00:00 2001
From: Stefan Kangas <[email-masked]>
Date: Sun, 30 Jun 2019 19:17:52 +0200
Subject: [PATCH] Make "M-x pdb" handle more valid file names

* lisp/progmodes/gud.el (gud-pdb-marker-regexp): Add "+" and
"[:alnum:]" to the regexp.  (Bug#34489)
---
 lisp/progmodes/gud.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 4306f5daa0..fdf53ff2e7 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -1606,7 +1606,7 @@ gud-pdb-history
 ;; Last group is for return value, e.g. "> test.py(2)foo()->None"
 ;; Either file or function name may be omitted: "> <string>(0)?()"
 (defvar gud-pdb-marker-regexp
-  "^> \\([-a-zA-Z0-9_/.:@ \\]*\\|<string>\\)(\\([0-9]+\\))\\([a-zA-Z0-9_]*\\|\\?\\|<module>\\)()\\(->[^\n\r]*\\)?[\n\r]")
+  "^> \\([-[:alnum:]_+/.:@ \\]*\\|<string>\\)(\\([0-9]+\\))\\([a-zA-Z0-9_]*\\|\\?\\|<module>\\)()\\(->[^\n\r]*\\)?[\n\r]")
 
 (defvar gud-pdb-marker-regexp-file-group 1)
 (defvar gud-pdb-marker-regexp-line-group 2)
-- 
2.11.0