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.
At least as far back as 2022, IPython allowed you to pass a
pathlib.Pathas thesrcparameter to theIPython.display.IFrameconstructor. As of 9.16.0, that fails with aTypeError: Path.replace() takes 2 positional arguments but 3 were given, because theIFrameconstructor now callshtml_escape(self.src). It looks like it's #15334 that changed this.If it was never supported to pass a
Pathand this only ever worked by coincidence, feel free to close this, but if this is an unintentional regression perhaps consider callinghtml_escape(str(self.src))instead.I noticed this because it breaks Memray's Jupyter integration.