-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
When using multiple urls, if given a path instead of filename, will result in error
await pdfgen.from_url(['http://example.com/1', 'http://example.com/2'], 'files/example.pdf', options=options)
[Errno 2] No such file or directory: '/var/folders/rj/ckmfygyj6sgc_4qd3mg0pq_c0000gn/T/files/example.pdf-0-0wca2ipo.pdf'
The prefix set on NamedTemporaryFile is incorrect and wil result in file not found error.
def _get_output_path(self, path, i, count):
if count > 1:
return NamedTemporaryFile(prefix=f'{path}-{i}-', suffix='.pdf', delete=False).name
else:
return path
So I think the NamedTemporaryFile should use tail of the path as prefix and suffix.
Metadata
Metadata
Assignees
Labels
No labels