Ticket #13857: default-umask.diff
File default-umask.diff, 1.7 KB (added by , 14 years ago) |
---|
-
django/core/files/storage.py
181 181 # OK, the file save worked. Break out of the loop. 182 182 break 183 183 184 if settings.FILE_UPLOAD_PERMISSIONS is not None: 185 os.chmod(full_path, settings.FILE_UPLOAD_PERMISSIONS) 184 mode = settings.FILE_UPLOAD_PERMISSIONS 185 if not mode: 186 # Read the system default by setting it, then set it back 187 mode = os.umask(0644) 188 os.umask(mode) 189 os.chmod(full_path, mode) 186 190 187 191 return name 188 192 -
docs/topics/http/file-uploads.txt
149 149 more information about what these modes mean, see the `documentation for 150 150 os.chmod`_ 151 151 152 If this isn't given or is ``None``, you'll get operating-system 153 dependent behavior. On most platforms, temporary files will have a mode 154 of ``0600``, and files saved from memory will be saved using the 155 system's standard umask. 156 152 Defaults to system's current umask, as returned by `os.umask`_. 153 157 154 .. warning:: 158 155 159 156 If you're not familiar with file modes, please note that the leading … … 177 174 files." 178 175 179 176 .. _documentation for os.chmod: http://docs.python.org/library/os.html#os.chmod 177 .. _os.umask: http://docs.python.org/library/os.html#os.umask 180 178 181 179 ``UploadedFile`` objects 182 180 ========================