Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1211 (closed defect: fixed)

Opened 12 years ago

Last modified 12 years ago

identity.soprovider.SqlObjectIdentity writes to read-only attribute

Reported by: Felix.Schwarz Owned by: anonymous
Priority: normal Milestone: 1.0
Component: SQLObject Version: 1.0b2
Severity: normal Keywords:
Cc:

Description

The patch attached uncovers an error in SqlObjectIdentity?. This error occurs on logout and prevents that the current identity is set to anonymous. It is masked by a catch-everything-and-ignore-it statement (line 139,140). The problem lies in line 137 ("anon.anonymous= True"). I think that the saprovider does not have this problem because the line is missing there. I will attach a test case patch which makes the error obvious.

I don't think that his has any implications for TurboGears applications because the session is invalidated before (line 133,134) but this bug is annoying for my own unit tests where I test that request.identity is being set correctly.

Attachments

soprovider_unreachable_code.patch Download (1.8 KB) - added by Felix.Schwarz 12 years ago.
patch for test_identity.py which adds a logout test case

Change History

Changed 12 years ago by Felix.Schwarz

patch for test_identity.py which adds a logout test case

comment:1 Changed 12 years ago by jorge.vargas

  • Milestone set to 1.0

comment:2 Changed 12 years ago by alberto

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in [2243]. Comments on the fix:

  • anon.annonymous doesn't need to be set to True as it will be True already because user is None. I don't think that property should be made read-write because of possible side-effects (maybe the visit key won't get deleted?)
  • I'm reraising any exception in that block because the user might remain logged in. This *might* break something, I'm not sure because I'm not familiar with the identity code. If it does at least the traceback will tell us ;)

Thanks for the tests, much appreciated :)

Alberto

Note: See TracTickets for help on using tickets.