﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
9936	file backed sessions not working because file rename fails	lrhazi	nobody	"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.



"		closed	contrib.sessions	dev		duplicate	sessions file		Unreviewed	0	0	0	0	0	0
