Multiple problems actually. You can't upload to a page called Image:something.py because .py files are blacklisted since they are actually stored as files with the .py extension, which could potentially get executed by the web browser, providing an attack vector for hackers. Fine, call the page something different.
The bigger problem is the one I have here, which can be uploaded using Upload but not using ImportProjectFiles. In ImportProjectFiles it gets the fatal error, 'This file contains HTML or script code that may be erroneously interpreted by a web browser.' This means ImportProjectFiles is doing some checking that Upload isn't. It should be consistent.
Anonymous
Also, we are now removing 'py' from the blacklist on our wikis.