Modify

Opened 6 years ago

Last modified 11 months ago

#5284 assigned defect

UndefinedError: {'is_trac_managed_hack': False} has no member named "username"

Reported by: anonymous Owned by: rjollos
Priority: normal Component: UserManagerPlugin
Severity: normal Keywords:
Cc: rjollos Trac Release: 0.11

Description (last modified by rjollos)

After installation I got this:

Trac detected an internal error: UndefinedError: {'is_trac_managed_hack': False} has no member named "username"

And:

File "/usr/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/web/main.py", line 423, in _dispatch_request
  dispatcher.dispatch(req)
File "/usr/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/web/main.py", line 219, in dispatch
  data, content_type)
File "/usr/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/web/chrome.py", line 726, in render_template
  stream.render(method, doctype=doctype, out=buffer)
File "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/core.py", line 179, in renderFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/output.py", line 61, in encodeFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/output.py", line 311, in __call__File "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/output.py", line 753, in __call__File "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/output.py", line 592, in __call__File "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/output.py", line 698, in __call__File "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/output.py", line 532, in __call__File "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/core.py", line 283, in _ensureFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/core.py", line 283, in _ensureFile "/usr/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/web/chrome.py", line 779, in _strip_accesskeys
  for kind, data, pos in stream:
File "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/core.py", line 283, in _ensureFile "/usr/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/web/chrome.py", line 768, in _generate
  for kind, data, pos in stream:
File "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/core.py", line 283, in _ensureFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/template/base.py", line 569, in _includeFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/template/markup.py", line 298, in _matchFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/template/markup.py", line 298, in _matchFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/template/markup.py", line 298, in _matchFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/template/markup.py", line 245, in _matchFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/template/base.py", line 543, in _execFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/template/base.py", line 533, in _evalFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/template/base.py", line 496, in _evalFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/template/base.py", line 551, in _flattenFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/core.py", line 283, in _ensureFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/path.py", line 141, in _generateFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/template/base.py", line 569, in _includeFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/template/markup.py", line 234, in _stripFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/template/base.py", line 543, in _execFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/template/base.py", line 533, in _evalFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/template/base.py", line 496, in _evalFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/template/base.py", line 551, in _flattenFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/core.py", line 283, in _ensureFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/path.py", line 141, in _generateFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/template/base.py", line 569, in _includeFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/template/markup.py", line 234, in _stripFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/template/base.py", line 543, in _execFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/template/base.py", line 533, in _evalFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/template/base.py", line 496, in _evalFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/template/base.py", line 551, in _flattenFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/core.py", line 283, in _ensureFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/path.py", line 141, in _generateFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/template/base.py", line 569, in _includeFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/template/markup.py", line 234, in _stripFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/template/base.py", line 543, in _execFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/template/base.py", line 496, in _evalFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/template/base.py", line 558, in _flattenFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/template/base.py", line 551, in _flattenFile "/usr/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/template/directives.py", line 377, in __call__File "/usr/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/util/compat.py", line 81, in next
  self.currkey = self.keyfunc(self.currvalue)
File "<string>", line 1, in <lambda.19>File "build/bdist.linux-i686/egg/acct_mgr/api.py", line 114, in has_userFile "build/bdist.linux-i686/egg/acct_mgr/svnserve.py", line 55, in has_userFile "/usr/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/config.py", line 251, in __contains__
  if self.config.parser.has_option(self.name, name):
File "/usr/lib/python2.5/ConfigParser.py", line 346, in has_option
  option = self.optionxform(option)
File "/usr/lib/python2.5/ConfigParser.py", line 336, in optionxform
  return optionstr.lower()
System Information:[[BR]]

User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16
Trac:	0.11
Python:	2.5.1 (r251:54863, Apr 8 2008, 01:20:16) [GCC 4.3.0 20080404 (Red Hat 4.3.0-6)]
setuptools:	0.6c9
SQLite:	3.5.6
pysqlite:	2.3.3
Genshi:	0.5.1
Subversion:	1.5.1 (r32289)
jQuery:	1.2.3

Attachments (1)

usermanager.diff (1.4 KB) - added by jun66j5 2 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 3 years ago by hasienda

  • Cc rjollos added; anonymous removed

Could someone make this description readable by meaningful formatting (Ryan, please help!).

comment:2 follow-up: Changed 3 years ago by rjollos

  • Description modified (diff)

Certainly!

comment:3 in reply to: ↑ 2 Changed 3 years ago by hasienda

Replying to rjollos:

Certainly!

Ah, much clearer now, thanks.

Changed 2 years ago by jun66j5

comment:4 Changed 2 years ago by jun66j5

I have the same issue with Trac 0.12.3. If [trac] ignore_auth_case is true, it happens.

usermanager.diff is ad-hoc patch for the issue.

comment:5 Changed 2 years ago by hasienda

(In [11640]) UserManagerPlugin: Fix issue a template issue, refs #5284.

The test in embedded python code obviously bails out when evaluating a dict without the 'username' key. While the real change will cope with the root cause of key renaming username -> user, this change will make at least this template more robust, and thats a good thing - too easy to ignore.

Thanks to Jun Omae for the suggestion.

comment:6 Changed 11 months ago by rjollos

  • Owner changed from cbalan to rjollos
  • Status changed from new to assigned

Add Comment

Modify Ticket

Action
as assigned The owner will remain rjollos.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.