When you download any text file, even if it has its own appendix (e.g. .css, .py), Safari tries to be clever and appends .txt to the file before saving it. (I love it when software thinks it knows what's good for you!).
Is there a hidden pref somewhere that will stop this forever?