OSError: [Errno 63] File name too long
I get the following error: OSError: [Errno 63] File name too long:
The problem is with old documents from 2020, where the doc_id is part of the filename (at least for one document in my case) and is written again in parentheses after it in line 136 in dl.py:
filename_with_doc_id = filename + “f” ({doc_id})”
This makes the filename too long!
Possible fix for line 136 in dl.py:
if filename.endswith(doc_id):
filename_without_id = filename[:-len(doc_id)].rstrip()
filename_with_doc_id = filename_without_id + f" ({doc_id})"
else:
filename_with_doc_id = filename + f" ({doc_id})"
Wouldn't it be enough to just use:
if filename.endswith(doc_id):
filename_with_doc_id = filename
else:
filename_with_doc_id = filename + f" ({doc_id})"
?
Yes, that would also be possible, but then you would have “filename doc_id.pdf” and “filename (doc_id).pdf”
I think it would be nicer if it was always the same, i.e. always in brackets, therefore my suggestion.
OK, understood. I added the code to PR #223.
Since the changes for the PR were merged and a new version released (v0.4.3) I'm closing this issue as resolved. Please let me know if there's still a problem with that fix.