Ticket #8616: file.py.diff

File file.py.diff, 719 bytes (added by wiser0, 15 years ago)

Windows specific patch for zero length session files.

  • D:/python26/Lib/site-packages/django-1.1-py2.6.egg/django/contrib/sessions/backends/

    old new  
    119119                    os.write(output_file_fd, self.encode(session_data))
    120120                finally:
    121121                    os.close(output_file_fd)
     122               
     123                # On Windows, old file must be removed or rename() will fail.
     124                if os.name == 'nt':
     125                    os.unlink(session_file_name)
     126
    122127                os.rename(output_file_name, session_file_name)
    123128                renamed = True
    124129            finally:
Back to Top