Fix error on Windows

This commit is contained in:
Jonathan van der Steege 2022-07-03 00:05:47 +02:00 committed by GitHub
parent df0c0d4d35
commit f2a926aecf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -64,7 +64,9 @@ class TextExporter:
except OSError as oserr:
title_length = len(str(entry.title))
if (
oserr.errno == errno.ENAMETOOLONG or oserr.errno == errno.ENOENT
oserr.errno == errno.ENAMETOOLONG
or oserr.errno == errno.ENOENT
or oserr.errno == errno.EINVAL
) and title_length > 1:
shorter_file_length = title_length // 2
entry.title = str(entry.title)[:shorter_file_length]