Django tries to add the suffix before the extension, but it doesn't account for compound extensions, so 'foo.tar.gz' becomes 'foo.tar_XXXXXXX.gz', which messes with shutil's file type detection.
Using a prefix instead solves this issue.
Resolves #2393 (closed).
I can't reproduce the exact issue in a test for some reason, but we already have a function checking the name, so that should be good enough.
Migrated from D3192 (view on Phabricator)