Skip to content

Restore pathlib.Path support in iFrame - #15348

Merged
Carreau merged 1 commit into
ipython:mainfrom
itsdaxen:fix/iframe-pathlib-support
Aug 3, 2026
Merged

Restore pathlib.Path support in iFrame#15348
Carreau merged 1 commit into
ipython:mainfrom
itsdaxen:fix/iframe-pathlib-support

Conversation

@itsdaxen

@itsdaxen itsdaxen commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Fixes #15345

PR #15334 broke pathlib.Path support in IFrame.repr_html() because html.escape() doesn't handle Path objects (it hits Path.replace() instead of converting to a string).

Changes:

  • Explicitly convert src to a string before passing it to html.escape().
  • Add a regression test using a path with & to verify both conversion and escaping work as expected.

@Carreau Carreau added this to the 9.16 milestone Aug 3, 2026
@Carreau

Carreau commented Aug 3, 2026

Copy link
Copy Markdown
Member

thanks.

@Carreau
Carreau merged commit cc8334e into ipython:main Aug 3, 2026
23 checks passed
Carreau pushed a commit to Carreau/ipython that referenced this pull request Aug 3, 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.

IPython 9.16.0 no longer allows passing a pathlib.Path as an IFrame's src

2 participants