Skip to content

Commit

Permalink
zimfile: replace OSError on Windows with a warning, #580
Browse files Browse the repository at this point in the history
  • Loading branch information
ilius committed Sep 12, 2024
1 parent 2a23966 commit c878cbd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pyglossary/plugins/zimfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,10 @@ def __iter__(self) -> "Iterator[EntryType | None]": # noqa: PLR0912
try:
f_namemax = os.statvfs(cacheDir).f_namemax # type: ignore
except AttributeError:
# FIXME
raise OSError("Unsupported operating system (no os.statvfs)") from None
log.warning("Unsupported operating system (no os.statvfs)")
# Windows: CreateFileA has a limit of 260 characters.
# CreateFileW supports names up to about 32760 characters (64kB).
f_namemax = 200

fileNameTooLong = []

Expand Down

0 comments on commit c878cbd

Please sign in to comment.