I'm having trouble with the Path concept. I'm using the ObjC PDFDocument.writeToFile method, but it just crashes Pythonista.
The relevant bit of code is:
outFilename = pathlib.Path(outFilename)
pdfDoc.writeToFile_(outFilename)
pdfDoc is a valid PDFDocument object, and outFilename is a path as a string. The location is Pythonistas own iCloud folder, copied from a dialogs.pick_document thing.