Replace extension separator by underscore in report name used as temporary file

This commit is contained in:
Cédric Krier
2026-01-28 10:39:07 +01:00
parent d7b80ff2ee
commit 14088e1de3
+2 -1
View File
@@ -429,7 +429,8 @@ class Report(URLMixin, PoolBase):
directory = tempfile.mkdtemp(prefix='trytond_')
input_extension = FORMAT2EXT.get(input_format, input_format)
output_extension = FORMAT2EXT.get(output_format, output_format)
path = pathlib.Path(directory, report.report_name)
path = pathlib.Path(
directory, report.report_name.replace(os.extsep, '_'))
input_path = path.with_suffix(os.extsep + input_extension)
output_path = path.with_suffix(os.extsep + output_extension)
mode = 'w+' if isinstance(data, str) else 'wb+'