Skip to content

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

Description

@godlygeek

At least as far back as 2022, IPython allowed you to pass a pathlib.Path as the src parameter to the IPython.display.IFrame constructor. As of 9.16.0, that fails with a TypeError: Path.replace() takes 2 positional arguments but 3 were given, because the IFrame constructor now calls html_escape(self.src). It looks like it's #15334 that changed this.

If it was never supported to pass a Path and this only ever worked by coincidence, feel free to close this, but if this is an unintentional regression perhaps consider calling html_escape(str(self.src)) instead.

I noticed this because it breaks Memray's Jupyter integration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions