Open
Labels
pathlib.PathSupport for `pathlib.Path` objects where `str` paths are supported.
Description
docx.document.Document.add_picture should support pathlib.Path objects.
Currently it returns an error if you try to pass the file name of the image as a pathlib.Path.
Metadata
Metadata
Assignees
Labels
pathlib.PathSupport for `pathlib.Path` objects where `str` paths are supported.
Activity
scanny commentedon Mar 10, 2026
Yeah, it was written in the days well before
pathlibappeared in Python 3.4.If you just do
str(path)in your call that will work for bothstrandpathlib.Pathpaths.But I'll have a look at adding this next time I'm in there :)