Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 2021

Show
Ignore:
Timestamp:
07/16/08 13:58:10
Author:
fumanchu
Message:

Fix for #840 (File-based sessions storage path is not stored as an absolute path). The unsafe instance kwargs in Session.__init__ were overriding the safe cls kwargs provided in FileSession?.setup().

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/lib/sessions.py

    r1932 r2021  
    283283    LOCK_SUFFIX = '.lock' 
    284284     
     285    def __init__(self, id=None, **kwargs): 
     286        # The 'storage_path' arg is required for file-based sessions. 
     287        kwargs['storage_path'] = os.path.abspath(kwargs['storage_path']) 
     288        Session.__init__(self, id=id, **kwargs) 
     289     
    285290    def setup(cls, **kwargs): 
    286291        """Set up the storage system for file-based sessions. 
     
    289294        automatically when using sessions.init (as the built-in Tool does). 
    290295        """ 
    291         if 'storage_path' in kwargs: 
    292             kwargs['storage_path'] = os.path.abspath(kwargs['storage_path']) 
     296        # The 'storage_path' arg is required for file-based sessions. 
     297        kwargs['storage_path'] = os.path.abspath(kwargs['storage_path']) 
    293298         
    294299        for k, v in kwargs.iteritems(): 

Hosted by WebFaction

Log in as guest/cpguest to create tickets