Skip to content

Fix attached quoted magic arguments - #15319

Open
zhangli091011 wants to merge 3 commits into
ipython:mainfrom
zhangli091011:fix-12729-quoted-magic-arguments
Open

Fix attached quoted magic arguments#15319
zhangli091011 wants to merge 3 commits into
ipython:mainfrom
zhangli091011:fix-12729-quoted-magic-arguments

Conversation

@zhangli091011

Copy link
Copy Markdown

Summary

  • keep attached quoted option values containing whitespace together for magic argument parsing
  • preserve the existing quote-retaining behavior for separate and positional quoted arguments
  • cover single and double quotes, escaped quotes, backslashes, Unicode, repeated options, and unchanged parsing behavior

Fixes #12729.

This takes a narrower approach than the stale #13027: only registered options using the attached --option=value form are normalized, rather than switching all magic parsing to POSIX semantics.

AI disclosure

🤖🍆 This pull request was prepared with an AI coding agent.

@zhangli091011

Copy link
Copy Markdown
Author

The external pre-commit.ci failure is caused by repository-wide baseline cleanup: its hooks attempted to rewrite many files outside this PR, including a workflow file, so autofix was suppressed. The changed files pass the repository formatting job, Ruff, MyPy, Darker, and the full cross-platform test matrix. I have intentionally not included unrelated repository-wide formatting changes.

@Carreau
Carreau force-pushed the fix-12729-quoted-magic-arguments branch 2 times, most recently from b9704e4 to 61798a8 Compare July 22, 2026 16:46
@zhangli091011

Copy link
Copy Markdown
Author

The targeted formatting failure is fixed in b9852c6; the formatting check, all test matrices, Read the Docs, pre-commit, and the other build jobs now pass. The remaining build (3.x) failure is a repository-wide Ruff invocation reporting 1,082 existing findings across unrelated files such as examples/, setup.py, setupbase.py, and tools/: https://github.com/ipython/ipython/actions/runs/30060019898/job/89379605834. None of the reported findings is in this PR diff, so I have not mixed unrelated lint cleanup into this bug fix.

@Carreau
Carreau force-pushed the fix-12729-quoted-magic-arguments branch from b9852c6 to 1a5e069 Compare July 24, 2026 20:16
@zhangli091011

Copy link
Copy Markdown
Author

All checks are now passing. A review when convenient would be appreciated.

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.

Unable to pass argument with space to cell magic

1 participant