Subject: bug#25194: 25.1; Python debugger breakpoint error

From: Andreas Röhler <[email-masked]>
Date: Tue, 13 Dec 2016 17:08:54 +0100

On 13.12.2016 13:25, Live System User wrote:
> Andreas Röhler <[email-masked]> writes:
>
>> On 13.12.2016 11:10, Live System User wrote:
>>> Hi,
>>>
>>>           When trying to debug a Python program, I get the following
>>>           error when trying to set a breakpoint:
>>>
>>> 0. emaccs -Q &
>>>
>>> 1. C-x C-f test.py
>>>
>>> 2. From the menubar:  Python->Debugger
>>>
>>> Run pdb (like this): python -m pdb test.py
>>>
>>> 3. Click on "Next Line" so I can see a source line
>>>
>>> 4. Cick on "Set Breakpoint"
>>>
>>>      I now get the error:
>>>             Wrong type argument: stringp, nil
>>>
>>>      Turning on `debug-on-error' yields the same results.
>>>      However, on the *Messages* buffer there is a little more
>>>      information about the error:
>>>
>>>          gud-format-command: Wrong type argument: stringp, nil
>>>
>>>      How does one debug this problem further?
>>>
>>>      Thanks.
>>>      
> [...]
>> Here it works calling just
>>
>> pdb test.py
>>
>> not "python -m"before
>    Normally, `pdb' is just a shell script that calls/execs
>    the Python debugger containing:
>
>      exec $python -m pdb $1 $2 $3 $4 $5 $6 $7 $8 $9
>
>
>   
As described
 From the menubar: Python->Debugger

That means being in an Emacs-buffer connected to Python-process in a 
special way.
The command to insert must match the environment, but didn't. That's why 
"gud-format-command:" raised the error.

IIUC `debug-on-error' adresses Emacs-lisp errors, not the Python-side.