#6453 closed defect (fixed)
Use registration fails: AttributeError: 'NoneType' object has no attribute 'encode'
Reported by: | Owned by: | John Hampton | |
---|---|---|---|
Priority: | normal | Component: | AccountManagerPlugin |
Severity: | major | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
Trac detected an internal error: AttributeError: 'NoneType' object has no attribute 'encode'
AccountManagerPlugin - trunk
Trac 0.11.6 - standalone mode
Attachments (0)
Change History (10)
comment:2 Changed 15 years ago by
have same problem with all versions of AccountManager plugin
[components] acct_mgr.admin.accountmanageradminpage = enabled acct_mgr.api.accountmanager = enabled acct_mgr.db.sessionstore = enabled acct_mgr.pwhash.htdigesthashmethod = enabled acct_mgr.web_ui.accountmodule = enabled acct_mgr.web_ui.emailverificationmodule = enabled acct_mgr.web_ui.loginmodule = enabled acct_mgr.web_ui.registrationmodule = enabled trac.web.auth.LoginModule = disabled [account-manager] password_store = SessionStore hash_method = HtDigestHashMethod
comment:3 Changed 15 years ago by
Got the same problem, running mod_wsgi/python2.5 and Trac-0.11.6. Tried to update everything, seems uptodate. Removed egg-cache and older egg-files. Still same issue. No login through webui, no password reset, no new user registration. Perhaps the full Traceback can help...
Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/Trac-0.11.6-py2.5.egg/trac/web/api.py", line 377, in send_error 'text/html') File "/usr/lib/python2.5/site-packages/Trac-0.11.6-py2.5.egg/trac/web/chrome.py", line 733, in render_template message = req.session.pop('chrome.%s.%d' % (type_, i)) File "/usr/lib/python2.5/site-packages/Trac-0.11.6-py2.5.egg/trac/web/api.py", line 195, in __getattr__ value = self.callbacks[name](self) File "/usr/lib/python2.5/site-packages/Trac-0.11.6-py2.5.egg/trac/web/main.py", line 265, in _get_session return Session(self.env, req) File "/usr/lib/python2.5/site-packages/Trac-0.11.6-py2.5.egg/trac/web/session.py", line 149, in __init__ if req.authname == 'anonymous': File "/usr/lib/python2.5/site-packages/Trac-0.11.6-py2.5.egg/trac/web/api.py", line 195, in __getattr__ value = self.callbacks[name](self) File "/usr/lib/python2.5/site-packages/Trac-0.11.6-py2.5.egg/trac/web/main.py", line 134, in authenticate authname = authenticator.authenticate(req) File "build/bdist.linux-x86_64/egg/acct_mgr/web_ui.py", line 438, in wrap return func(self, *args, **kwds) File "build/bdist.linux-x86_64/egg/acct_mgr/web_ui.py", line 448, in authenticate req.environ['REMOTE_USER'] = self._remote_user(req) File "build/bdist.linux-x86_64/egg/acct_mgr/web_ui.py", line 475, in _remote_user if AccountManager(self.env).check_password(user, password): File "build/bdist.linux-x86_64/egg/acct_mgr/api.py", line 140, in check_password valid = store.check_password(user, password) File "build/bdist.linux-x86_64/egg/acct_mgr/db.py", line 76, in check_password return self.hash_method.check_hash(user, password, hash) File "build/bdist.linux-x86_64/egg/acct_mgr/pwhash.py", line 52, in check_hash return hash == self.generate_hash(user, password) File "build/bdist.linux-x86_64/egg/acct_mgr/pwhash.py", line 48, in generate_hash user,password,realm = _encode(user, password, self.realm) File "build/bdist.linux-x86_64/egg/acct_mgr/pwhash.py", line 56, in _encode return [a.encode('utf-8') for a in args] AttributeError: 'NoneType' object has no attribute 'encode'
comment:6 Changed 15 years ago by
Replying to luis.kop@gmail.com:
Downgrade to 0.11.1 solve for now
This isn't a solution, just a workaround.
The solution is for the author to fix this bug. I'm sure it's not hard, but I doubt he/she has read this bug report.
If anyone knows how to contact the author directly, that might help.
comment:7 Changed 15 years ago by
Status: | new → assigned |
---|
OK, sorry for the late response. Can anyone provide me with a bit more info? Does this only happen with the SessionStore backend? Does it also happen with htdigest or basic auth?
I don't know why the behavior changed between 0.11.5 and 0.11.6, I'll have to take a deeper look at the changeset for 0.11.6.
On line 45 of acct_mgr.pwhash change:
realm = Option('account-manager', 'htdigest_realm')
to
realm = Option('account-manager', 'htdigest_realm', '')
It's untested, but may work. I'll be at PyCon later this week and will have some time to investigate further and commit a fix.
comment:8 Changed 15 years ago by
I have the same problem. The fix above worked for me. I'm using trac 0.11.6 and account manager plugin 0.2.1dev with Python 2.5.1.
comment:10 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |