Opened 16 years ago
Closed 16 years ago
#9936 closed (duplicate)
file backed sessions not working because file rename fails
Reported by: | lrhazi | Owned by: | nobody |
---|---|---|---|
Component: | contrib.sessions | Version: | dev |
Severity: | Keywords: | sessions file | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
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.
#9084 already covers this, I believe.