Merged upstream fix restoring pathlib.Path support in IPython IFrame rendering.
Reproduced the regression, traced the failing conversion boundary, converted the source to a string before escaping, and added focused regression coverage that also verifies special-character escaping.