Skip to content

Commit 2183aff

Browse files
committed
Glossary: write: avoid removing trailing / from filename
allow converting to a directory with StarDict, #694
1 parent fec9d74 commit 2183aff

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pyglossary/glossary_v2.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,10 @@ def _write(
953953
sort: bool = False,
954954
**options: Any,
955955
) -> str:
956+
filenameOrig = filename
956957
filename = os.path.abspath(filename)
958+
if filenameOrig.endswith(os.sep):
959+
filename += os.sep
957960

958961
if formatName not in PluginHandler.plugins:
959962
raise WriteError(f"No plugin {formatName!r} was found")

0 commit comments

Comments
 (0)