summaryrefslogtreecommitdiffstats
path: root/Lib/zipfile.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/zipfile.py')
-rw-r--r--Lib/zipfile.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/zipfile.py b/Lib/zipfile.py
index fc6ca65..e3b7a61 100644
--- a/Lib/zipfile.py
+++ b/Lib/zipfile.py
@@ -1685,8 +1685,8 @@ class ZipFile:
table = str.maketrans(illegal, '_' * len(illegal))
cls._windows_illegal_name_trans_table = table
arcname = arcname.translate(table)
- # remove trailing dots
- arcname = (x.rstrip('.') for x in arcname.split(pathsep))
+ # remove trailing dots and spaces
+ arcname = (x.rstrip(' .') for x in arcname.split(pathsep))
# rejoin, removing empty parts.
arcname = pathsep.join(x for x in arcname if x)
return arcname