#12561 closed defect (fixed)
AttributeError: 'FakeSession' object has no attribute 'as_int'
| Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.2 |
| Component: | general | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: |
Fixed regression in r14707 that resulted in |
||
| API Changes: |
|
||
| Internal Changes: | |||
Description
I noticed while working on #12559 that due to changes in #12446, the following can result when an exception is raised:
Traceback (most recent call last):
File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/web/api.py", line 710, in send_error
data, 'text/html')
File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/web/chrome.py", line 1138, in render_template
if not req.session.as_int('accesskeys', 0):
AttributeError: 'FakeSession' object has no attribute 'as_int'
For example, raise an exception in get_connection:
-
trac/db/sqlite_backend.py
187 187 yield 'sqlite', -1 if self.error else 1 188 188 189 189 def get_connection(self, path, log=None, params={}): 190 raise Exception() 190 191 self.required = True 191 192 params['extensions'] = self._extensions 192 193 if path == ':memory:':
Attachments (0)
Change History (6)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
| Release Notes: | modified (diff) |
|---|
I've settled on using SessionDict for the new class: [0d27c082/rjollos.git], however I'll consider any feedback.
comment:4 by , 9 years ago
| API Changes: | modified (diff) |
|---|---|
| Resolution: | → fixed |
| Status: | assigned → closed |
follow-up: 6 comment:5 by , 9 years ago
Should we modify the initializer of SessionDict to have the same signature as dict, in order to avoid problems like that in th:r16119?
comment:6 by , 9 years ago
Replying to Ryan J Ollos:
Should we modify the initializer of
SessionDictto have the same signature asdict, in order to avoid problems like that in th:r16119?



Proposed changes in log:rjollos.git:t12561.1.