Django

Code

Ticket #9936 (closed: duplicate)

Opened 1 year ago

Last modified 1 year ago

file backed sessions not working because file rename fails

Reported by: lrhazi Assigned to: nobody
Milestone: Component: django.contrib.sessions
Version: SVN Keywords: sessions file
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

Using latest svn jython-dev, django-dev and django-jython, on Windows XP Pro x64:

Jython 2.5b0+ (trunk, Dec 30 2008, 21:59:18) [Java HotSpot?(TM) 64-Bit Server VM (Sun Microsystems Inc.)] on java1.6.0_11

no data is ever saved to the session files, their size always remains zero bytes.

in file django-dev\django\contrib\sessions\backends\file.py

around line 140, made this change: #except (OSError, IOError, EOFError):

except Exception,e:

logging.debug("session.save: exception %s"%repr(e)) pass

to discover this error: session.save: exception OSError(0, "couldn't rename file")

The two file names involved: H:\My Dev\ipool\ipool\session_dir\iPoolSessionID749b497bbcd689e20e16a0e634966504_out_8wuuxd and H:\My Dev\ipool\ipool\session_dir\iPoolSessionID749b497bbcd689e20e16a0e634966504

renaming them directly from jython shell, using os.rename() works fine.

replaced os.rename with shutil.copy and sessions seem to work as expected.

Thanks a lot. Mohamed.

Attachments

Change History

12/30/08 23:05:37 changed by kmtracey

  • status changed from new to closed.
  • needs_better_patch changed.
  • resolution set to duplicate.
  • needs_tests changed.
  • needs_docs changed.

#9084 already covers this, I believe.


Add/Change #9936 (file backed sessions not working because file rename fails)




Change Properties
Action