You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-commits@quetz.apache.org by nl...@apache.org on 2005/04/28 10:12:44 UTC

svn commit: r165115 - /httpd/mod_python/trunk/lib/python/mod_python/FileSession.py

Author: nlehuen
Date: Thu Apr 28 01:12:43 2005
New Revision: 165115

URL: http://svn.apache.org/viewcvs?rev=165115&view=rev
Log:
Fixed the problem with FileSession under Win32 : the session file had to be opened (for read & write) in binary mode.

Modified:
    httpd/mod_python/trunk/lib/python/mod_python/FileSession.py

Modified: httpd/mod_python/trunk/lib/python/mod_python/FileSession.py
URL: http://svn.apache.org/viewcvs/httpd/mod_python/trunk/lib/python/mod_python/FileSession.py?rev=165115&r1=165114&r2=165115&view=diff
==============================================================================
--- httpd/mod_python/trunk/lib/python/mod_python/FileSession.py (original)
+++ httpd/mod_python/trunk/lib/python/mod_python/FileSession.py Thu Apr 28 01:12:43 2005
@@ -65,9 +65,8 @@
         self.lock_file()
         try:
             try:
-                # TODO : why does this load fails sometimes with an EOFError ?
                 filename = os.path.join(self._sessdir, 'mp_sess_%s' % self._sid)
-                fp = file(filename)
+                fp = file(filename,'rb')
                 try:
                     data = cPickle.load(fp)
                     if (time.time() - data["_accessed"]) <= data["_timeout"]:
@@ -91,7 +90,8 @@
         self.lock_file()
         try:
             try:
-                fp = file(os.path.join(self._sessdir, 'mp_sess_%s' % self._sid), 'w+')
+                filename = os.path.join(self._sessdir, 'mp_sess_%s' % self._sid)
+                fp = file(filename, 'wb')
                 try:
                     cPickle.dump(dict, fp, 2)
                 finally: