Code

Opened 6 years ago

Closed 6 years ago

#9936 closed (duplicate)

file backed sessions not working because file rename fails

Reported by: lrhazi Owned by: nobody
Component: contrib.sessions Version: master
Severity: Keywords: sessions file
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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 (0)

Change History (1)

comment:1 Changed 6 years ago by kmtracey

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

#9084 already covers this, I believe.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.