django/django — pull request #326 by lotheac (2012-09-05 15:10:40+00:00)
Title: don't make uploaded files executable by default

Apparently Django creates uploaded files with the exec bit set by default, since it uses os.open() without specifying mode and Python defaults mode to 0777 (it must be specified for the open(2) syscall if O_CREAT is given). This is easily fixed by setting os.open()'s mode argument to 0666 (it will still be masked by umask, and user specified mode will be set by chmod afterwards if necessary).