kovidgoyal/calibre — pull request #118 by user-none (2013-10-12 22:31:14+00:00)
Title: Fix title of downloaded ebooks.

The issue was the book is downloaded to a temporary file using PersistentTemporaryFile and the filename was set as the suffix. This ended up creating a filename with random text and the real filename appended after. When implemented it was assumed the suffix would become the filename instead of being appended after the filename.

The fix is to download to a temporary directory and create the file with the filename unaltered.