Opened 13 years ago

Last modified 6 years ago

#4282 assigned New feature

startproject should honor umask

Reported by: talex5+django@… Owned by: merb
Component: Core (Management commands) Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no


Ticket #1651 fixed the problem of not being made executable by copying *all* the permission bits (not just the executable flags). This means that the user's umask doesn't work, e.g.:

$ umask 077
$ touch foo
$ ls -l foo
-rw------- 1 talex talex 0 2007-05-12 13:27 foo

$ PYTHONPATH=trunk ./trunk/django/bin/ startproject mysite
$ ls -l mysite/ 
-rw-r--r-- 1 talex talex 2804 2007-05-12 13:28 mysite/

I discovered this whilst trying to make a Zero Install package for Django. Everything in the Zero Install cache is read-only, so startproject fails with:

  File "/var/cache/", line 799, in startproject
    fp = open(main_settings_file, 'w')
IOError: [Errno 13] Permission denied: '.../site/'


Attachments (3)

permissions.patch (1.4 KB) - added by talex5+django@… 13 years ago.
django-4282.diff (1.5 KB) - added by Fredrik Lundh <fredrik@…> 13 years ago.
Updated patch, against revision 6281.
4282_against_16741.diff (1.6 KB) - added by Peter Baumgartner 9 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 13 years ago by Simon G. <dev@…>

Summary: startproject doesn't honour umaskstartproject should honour umask
Triage Stage: UnreviewedAccepted

comment:2 Changed 13 years ago by Adrian Holovaty

Summary: startproject should honour umaskstartproject should honor umask

Seems like a good improvement to me. A patch would be great.

Changed 13 years ago by talex5+django@…

Attachment: permissions.patch added


comment:3 Changed 13 years ago by anonymous

Has patch: set

comment:4 Changed 13 years ago by anonymous

Any comments on this patch? Is it OK?

comment:5 Changed 13 years ago by Fredrik Lundh <fredrik@…>

The patch doesn't apply any more (the relevant code is now in django/core/management/ I've adapted the patch, but I'm not sure how this should interact with the _make_writeable call. I'll upload the updated patch anyway, just in case.

Changed 13 years ago by Fredrik Lundh <fredrik@…>

Attachment: django-4282.diff added

Updated patch, against revision 6281.

comment:6 Changed 10 years ago by Adam Nelson

Patch needs improvement: set

Patch needs to be updated again.

comment:7 Changed 9 years ago by Łukasz Rekucki

Severity: Normal
Type: New feature

Changed 9 years ago by Peter Baumgartner

Attachment: 4282_against_16741.diff added

comment:8 Changed 9 years ago by Peter Baumgartner

Easy pickings: unset
UI/UX: unset

Confirmed issue still exists in r16741. This patch applies cleanly and fixes the issue.

comment:9 Changed 7 years ago by merb

Owner: changed from nobody to merb
Status: newassigned

comment:10 Changed 7 years ago by merb

I uploaded & updated the pull request.
would be great if somebody will making suggestions.

comment:11 Changed 6 years ago by Claude Paroz

Comment added on the pull request.

Note: See TracTickets for help on using tickets.
Back to Top