rstrip the template string (#5235)

This commit is contained in:
Alexey Bogomolov 2023-07-07 14:38:35 +03:00 committed by GitHub
parent 789f2105e1
commit 99efc0e735
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -157,6 +157,8 @@ def deliver_single_file(
delivery_path = delivery_path.replace("..", ".")
# Make sure path is valid for all platforms
delivery_path = os.path.normpath(delivery_path.replace("\\", "/"))
# Remove newlines from the end of the string to avoid OSError during copy
delivery_path = delivery_path.rstrip()
delivery_folder = os.path.dirname(delivery_path)
if not os.path.exists(delivery_folder):