Skip to content

Accept a quoted FILE:LINE in %debug --breakpoint - #15434

Merged
Carreau merged 4 commits into
ipython:mainfrom
kaanisthatyou:fix/debug-breakpoint-quoted-path
Oct 21, 2026
Merged

Carreau merged 4 commits into
ipython:mainfrom
kaanisthatyou:fix/debug-breakpoint-quoted-path

Conversation

@kaanisthatyou

Copy link
Copy Markdown
Contributor

Fixes #14098. 🤖🤖 (written with an AI coding agent, Claude Code)

A breakpoint in a file whose path has spaces (e.g. a venv under macOS Application Support) can only be given quoted, but arg_split keeps the quotes, so %debug --breakpoint "My Project/a.py:2" f() failed with ValueError: invalid literal for int() with base 10: '2"'. Unquoted, the path is split at the space. This strips matching surrounding quotes before splitting FILE:LINE, the same way %alias_magic and %%writefile handle their quoted arguments.

The new test puts a module in a folder with a space, sets a quoted breakpoint on a line after the first one (the first line of the file is already a stop), and checks through bdb that the breakpoint was set on that line and hit once.

kaanisthatyou and others added 2 commits October 13, 2026 01:38
A path with spaces can only be passed quoted, but the argument parser
keeps the quotes, so `%debug --breakpoint "My Project/a.py:2" f()`
failed with `ValueError: invalid literal for int() with base 10: '2"'`.
Strip matching surrounding quotes before splitting FILE:LINE, as
%alias_magic and %%writefile already do for their arguments.

Fixes ipython#14098

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread IPython/core/magics/execution.py Resolved
Comment thread IPython/core/magics/execution.py Resolved
@Carreau
Carreau merged commit fe5ea4f into ipython:main Oct 21, 2026
25 checks passed
@Carreau Carreau added this to the 9.18 milestone Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

%debug --breakpoint doesn't work with space in filename

2 participants