Hello, The recipe: 1. emacs -Q 2. Create a remote python file and start the remote python shell, e.g. M-x find-file /ssh:server:/tmp/test.py M-x run-python 3. Insert the following code in test.py and press C-c C-c to send it to the python shell: def f(): breakpoint() return 1 4. Execute f() in the python shell to trigger the pdb Result: Emacs tries to open /ssh:server:/ssh:server:/tmp/test.py instead of /ssh:server:/tmp/test.py. The reason is the filename set by python-shell-send-string may be remote. The attached patch fixes the issue. -- Liu Hui