Fix: Made bpy.path.ensure_ext compatible with compound extensions.
authorSybren A. Stüvel <sybren@stuvel.eu>
Thu, 3 Sep 2015 11:09:16 +0000 (13:09 +0200)
committerSybren A. Stüvel <sybren@stuvel.eu>
Thu, 3 Sep 2015 11:09:16 +0000 (13:09 +0200)
commit8383a2d4cc32c8516f11364aae079aeae93116c9
treebccd244c9f8e82a64d72ca7b6134d9a6d047802a
parente5e65b1099c2d146614691c9e54c95b99f8d8685
Fix: Made bpy.path.ensure_ext compatible with compound extensions.

Extensions such as ".tar.gz" are now also supported. Before this patch,
ensure_ext('demo.tar.gz', '.tar.gz') would return 'demo.tar.tar.gz'.

This results in issues with the `ExportHelper` mix-in class; clicking
an existing file in the file dialogue warns about overwriting it
(highlighting the input box in red), but then saves to a different
file.

Also added a unit test for the new behaviour.

Reviewers: mont29, campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1498
release/scripts/modules/bpy/path.py
tests/python/bl_bpy_path.py [new file with mode: 0644]