details:   https://code.tryton.org/tryton/commit/b18cf7cbaa54
branch:    8.0
user:      Cédric Krier <[email protected]>
date:      Thu May 07 13:34:06 2026 +0200
description:
        Do not add empty extension when slugify filename

        Closes #14823
        (grafted from 143883125d7e98b0fcdc300b54886d735c228fe9)
diffstat:

 tryton/tryton/common/common.py |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (15 lines):

diff -r f69b5fa904c2 -r b18cf7cbaa54 tryton/tryton/common/common.py
--- a/tryton/tryton/common/common.py    Wed May 06 09:23:35 2026 +0200
+++ b/tryton/tryton/common/common.py    Thu May 07 13:34:06 2026 +0200
@@ -595,7 +595,10 @@
         name, ext = filename
     else:
         name, ext = os.path.splitext(filename)
-    return ''.join([slugify(name), os.extsep, slugify(ext)])
+    parts = [slugify(name)]
+    if ext:
+        parts.extend([os.extsep, slugify(ext)])
+    return ''.join(parts)
 
 
 def file_write(filename, data):

Reply via email to