When path to export is in the form if "/some/folder/.stl", any regular path functions (BLI_path_suffix, BLI_path_extension_replace etc.) would not treat it as having ".stl" extension, but rather as a hidden file called ".stl". And so BLI_path_suffix would turn it into "/some/folder/.stlCube". To prevent this, detect this exact case when the whole basename is just ".stl", and remove the ".stl" part before using other path functions. Pull Request: https://projects.blender.org/blender/blender/pulls/125179