Modify

Opened 11 years ago

Closed 8 years ago

#11312 closed defect (fixed)

Variable `user' does not exist (api.py around lines 410~420)

Reported by: Pierre-Yves Strub Owned by: Steffen Hoffmann
Priority: normal Component: AccountManagerPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

See attached patch for a fix.

Attachments (1)

0001-bug-fix-local-variable-user-does-not-exist.patch (835 bytes) - added by Pierre-Yves Strub 11 years ago.

Download all attachments as: .zip

Change History (10)

Changed 11 years ago by Pierre-Yves Strub

comment:1 Changed 11 years ago by Steffen Hoffmann

Resolution: invalid
Status: newclosed
Trac Release: 1.00.11

Why does your patch try to fix something, that is not broken?

In fact, neither does current `trunk` code contain the old line referenced in your patch nor does that line even exist in current stable (0.4.3). AFAIKS the relevant code has been put in place with revision [13290] - almost three months ago, too late for last stable release - and has never been changed so far. You must be looking at a side-effect of local modifications to your copy of the source, if you see need for the proposed fix.

I cannot see another explanation, sorry. Proof me wrong, if you can, but you'll need to tell me exactly where to apply the fix too.

Anyway, I'd be even more interested in what and why you change the API source, so that we could probably learn something for the official development branch.?

comment:2 in reply to:  1 Changed 11 years ago by Pierre-Yves Strub

Replying to hasienda:

The patch has been done w.r.t trunk, in this case:

https://trac-hacks.org/svn/accountmanagerplugin/trunk

If trunk is not the head of your dev., could you tell me where the current development of the plugin takes place? Otherwise, line 419 is the exact line number. I indeed have local modifications, but the patch applies without any fuzziness on a fresh checkout of trunk.

To reproduce, on an unmodified trunk, take any password store that raises an exception in IPasswordStore.set_password before having creating the user. (The htpassword backend with a read-only password file will do it) Go to the administration panel for creating a user. At creation, you'll end with the following exception:

Trac detected an internal error:
  NameError: global name 'user' is not def

File "/home/strub/Projects/Trac/trac-env/local/lib/python2.7/site-packages/trac/web/main.py", line 497, in _dispatch_request
File "/home/strub/Projects/Trac/trac-env/local/lib/python2.7/site-packages/trac/web/main.py", line 214, in dispatch
File "/home/strub/Projects/Trac/trac-env/local/lib/python2.7/site-packages/trac/admin/web_ui.py", line 125, in process_request
File "build/bdist.linux-i686/egg/acct_mgr/admin.py", line 231, in render_admin_panel
File "build/bdist.linux-i686/egg/acct_mgr/admin.py", line 865, in _do_users
File "build/bdist.linux-i686/egg/acct_mgr/admin.py", line 1207, in _do_add
File "build/bdist.linux-i686/egg/acct_mgr/api.py", line 389, in validate_account
File "build/bdist.linux-i686/egg/acct_mgr/api.py", line 419, in _create_user

Regarding your last question, I'm currently defining some new interfaces s.t. users can record some credential payloads that can then be used by other plugins for authentication.

Last edited 11 years ago by Pierre-Yves Strub (previous) (diff)

comment:3 in reply to:  1 ; Changed 11 years ago by Ryan J Ollos

Replying to hasienda:

In fact, neither does current `trunk` code contain the old line referenced in your patch nor does that line even exist in current stable (0.4.3).

You may want to take another look. Unless my mind is completely shot this evening, it looks like the patch applies directly to the lines that you point to with the TracLink.

comment:4 in reply to:  3 Changed 11 years ago by Steffen Hoffmann

Resolution: invalid
Status: closedreopened

Replying to rjollos:

You may want to take another look. Unless my mind is completely shot this evening, it looks like the patch applies directly to the lines that you point to with the TracLink.

Hm, dunno why, but I've been aiming at line 416 instead of 419, indeed. Sorry.

comment:5 Changed 11 years ago by Steffen Hoffmann

Status: reopenednew

comment:6 Changed 11 years ago by Steffen Hoffmann

In 13381:

AccountManagerPlugin: Correct another occurance of user to username refs #11312.

And thanks to Pierre-Yves Strub for testing beyond current unit test harness.

comment:7 Changed 11 years ago by Steffen Hoffmann

Well, this ticket could be closed, arguing there is no stable release out there with this bug. But let's stick to my usual habit to keep tickets open until next release, maybe for the sake of other early adopters to note the issue more easily.

comment:8 Changed 10 years ago by Steffen Hoffmann

Status: newaccepted

comment:9 Changed 8 years ago by Ryan J Ollos

Resolution: fixed
Status: acceptedclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Steffen Hoffmann.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.