Ticket #5443: jython_no_os_access.patch

File jython_no_os_access.patch, 838 bytes (added by leosoto <leo.soto@…>, 17 years ago)

Simple patch

  • django/core/management/base.py

    diff -r a729ba90ca04 django/core/management/base.py
    a b def _make_writeable(filename):  
    206206def _make_writeable(filename):
    207207    "Makes sure that the file is writeable. Useful if our source is read-only."
    208208    import stat
    209     if not os.access(filename, os.W_OK):
    210       st = os.stat(filename)
    211       new_permissions = stat.S_IMODE(st.st_mode) | stat.S_IWUSR
    212       os.chmod(filename, new_permissions)
     209    if not sys.platform.startswith('java'): # On Jython there is no os.access()
     210        if not os.access(filename, os.W_OK):
     211            st = os.stat(filename)
     212            new_permissions = stat.S_IMODE(st.st_mode) | stat.S_IWUSR
     213            os.chmod(filename, new_permissions)
Back to Top