Issue #293 resolved

File based sessions require sessionFilter.storagePath to be set

John P. Speno
created an issue

If you use sessionFilter.storagetype = 'File' and don't set sessionfilter.storagePath, you get this nice traceback:

{{{ Traceback (most recent call last): File "/usr/local/lib/python2.4/site-packages/cherrypy/_cphttptools.py", line 270, in run applyFilters('beforeRequestBody') File "/usr/local/lib/python2.4/site-packages/cherrypy/_cphttptools.py", line 654, in applyFilters method() File "/usr/local/lib/python2.4/site-packages/cherrypy/lib/filter/sessionfilter.py", line 144, in beforeRequestBody sess.sessionStorage.acquireLock() File "/usr/local/lib/python2.4/site-packages/cherrypy/lib/filter/sessionfilter.py", line 265, in acquireLock filePath = self._getFilePath(cherrypy.session['_id']) File "/usr/local/lib/python2.4/site-packages/cherrypy/lib/filter/sessionfilter.py", line 308, in _getFilePath filePath = os.path.join(storagePath, fileName) File "/usr/local/lib/python2.4/posixpath.py", line 62, in join elif path == '' or path.endswith('/'): AttributeError: 'NoneType' object has no attribute 'endswith' }}}

I think a default path is needed, updated documentation, or a better failure message.

Comments (6)

  1. Anonymous

    I default path will still be a problem if it doesn't exist, so I vote for a nicer error message. This is very similar to ticket:272

  2. Log in to comment