I've attached a patch that checks if os.unlink is available before creating the Windows TemporaryFile hack. Note I'm a Python newbie so it might not be the right way to go about it, but you'll get the idea.

Also, FWIW, the bug reporting and patch submission guideline links in the "Create New Ticket" instructions don't seem to work.

Change History (8)

I don't think this is really the solution, since Guido's point is really the root cause.

It sounds like we need a setting for the file-size management that says "never, ever save to disk" and then if you've set that and somebody uploads something that eats all your memory, that's your problem. Either we can write to disk (in which case os.unlink has to exist so we can manage the files properly) or we can't, in which case we should allow the user to specify that. Transparently moving into that "don't write to disk mode" would be dangerous, however, since it really does run the risk of a small denial of service style attack so the person setting up the applications must agree to that explicitly.