#30807: test_extract_file_permissions test fails when umask is set to 000.
-----------------------------------+------------------------------------
     Reporter:  Brady              |                    Owner:  nobody
         Type:  Bug                |                   Status:  new
    Component:  Testing framework  |                  Version:  master
     Severity:  Normal             |               Resolution:
     Keywords:                     |             Triage Stage:  Accepted
    Has patch:  0                  |      Needs documentation:  0
  Needs tests:  0                  |  Patch needs improvement:  0
Easy pickings:  0                  |                    UI/UX:  0
-----------------------------------+------------------------------------

Comment (by Ad Timmering):

 The same issue happens on Windows Linux Subsystem which has a default
 umask of 0 (see [https://github.com/microsoft/WSL/issues/352 this thread]
 - fix is apparently inbound).

 If I'm reading this correctly, the test incorrectly assumes all systems
 have at least a umask of 2 (no write for world), and the fix would be to
 change the test to assume `0o666`. For systems that ''do'' have a umask of
 2, this will keep working as intended as it already negates the OS umask
 with ` & umask`.
 {{{
 self.assertEqual(os.stat(filepath).st_mode & mask, 0o664 & ~umask)
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30807#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.ed8f8c71cdd06c0917210f80380600a1%40djangoproject.com.

Reply via email to