On Nov 2, 2011, at 8:20 AM, Anthony wrote: > How are you making use of None values in Storage keys?
It turns out that Settings depends on that behavior (note its last line). Auth.__init__ sets auth.settings.hmac_key to None by default, and then sets lock_keys. The presence of the None value (or at least *some* value) is what allows the user to later set a new value for hmac_key. So I'll revert the __setitem__ change, I guess, but keep the __getitem__ change. > > On Wednesday, November 2, 2011 10:59:01 AM UTC-4, Carlos wrote: > Hi, > > I'm using web2py latest trunk on win7. > > As soon as I applied the following changeset: > > ce20196cd7b895029ed667ecff505987ee83d727 - (ce20196cd7b8) storage patch > > I got errors both in shell and web requests ... > > auth.settings.hmac_key = 'sha512:5fd2a4d2-d703-476c-8184-800b84e453b8' > File "C:\web2py\gluon\storage.py", line 199, in __setattr__ > raise SyntaxError, 'setting key \'%s\' does not exist' % key > SyntaxError: setting key 'hmac_key' does not exist > > If I reload the immediate prior changeset, everything works ok again. > > Based on what I see in this change, you are now removing the Storage key also > via __setitem__ (in addition to __setattr__). > > But I need a way to assign None to a Storage key, for which I was using: > mystorage['key'] = None (which did assign None and did not remove the key). > > Now I would have no way to assign a None value to a Storage key?. > > Plus the above error I get in Settings. > > Can this change be reverted?, or what do you recommend instead?. > > Thanks, > > Carlos >

