#6560 closed defect (worksforme)
trac-admin bug with empty priority names
| Reported by: | Owned by: | Christopher Lenz | |
|---|---|---|---|
| Priority: | lowest | Milestone: | |
| Component: | admin/console | Version: | 0.11b1 |
| Severity: | major | Keywords: | |
| Cc: | Thijs Triemstra | Branch: | |
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description (last modified by )
trac-admin <dir> priority add one priority add "" priority order one down
the above command gives error
Trac [/usr/local/apache2/htdocs/test]> priority order " " up
Traceback (most recent call last):
File "/usr/bin/trac-admin", line 7, in ?
sys.exit(
File "/usr/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/admin/console.py", line 1198, in run
admin.run()
File "/usr/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/admin/console.py", line 119, in run
self.cmdloop()
File "/usr/lib/python2.4/cmd.py", line 142, in cmdloop
stop = self.onecmd(line)
File "/usr/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/admin/console.py", line 102, in onecmd
rv = cmd.Cmd.onecmd(self, line) or 0
File "/usr/lib/python2.4/cmd.py", line 219, in onecmd
return func(arg)
File "/usr/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/admin/console.py", line 847, in do_priority
self._do_enum('priority', line)
File "/usr/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/admin/console.py", line 916, in _do_enum
self._do_enum_order(type, name, direction)
File "/usr/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/admin/console.py", line 950, in _do_enum_order
enum1.value = int(float(enum1.value) + direction)
TypeError: float() argument must be a string or a number
Attachments (0)
Change History (11)
follow-ups: 2 9 comment:1 by , 18 years ago
follow-ups: 3 7 comment:2 by , 18 years ago
Replying to sid:
There is a simple fix here - don't add a priority with no value. Propose closing as a
wontfix.
A simple test (using the same code) would not harm, rather than to let the MMI to accept and store an invalid value. trac-admin may be scripted, and it should not corrupt the DB with invalid input values.
comment:3 by , 18 years ago
Replying to eblot:
Replying to sid:
There is a simple fix here - don't add a priority with no value. Propose closing as a
wontfix.A simple test (using the same code) would not harm, rather than to let the MMI to accept and store an invalid value. trac-admin may be scripted, and it should not corrupt the DB with invalid input values.
+1
comment:4 by , 18 years ago
#5316 was closed as a duplicate based on the assumption that the real issue is that trac-admin allows creating blank names - that ticket reported a webadmin traceback when trying to delete several tickets, one of which was blank.
comment:5 by , 18 years ago
| Description: | modified (diff) |
|---|---|
| Milestone: | → 0.12 |
Like manu said in comment:2, should be a small fix.
comment:6 by , 17 years ago
| Keywords: | verify added |
|---|---|
| Summary: | trac-admin bug → trac-admin bug with empty priority names |
comment:7 by , 15 years ago
| Cc: | added |
|---|---|
| Severity: | minor → major |
Replying to eblot:
A simple test (using the same code) would not harm, rather than to let the MMI to accept and store an invalid value. trac-admin may be scripted, and it should not corrupt the DB with invalid input values.
If this can corrupt the database than the severity should be higher.
comment:8 by , 15 years ago
| Cc: | added; removed |
|---|
comment:9 by , 15 years ago
| Keywords: | verify removed |
|---|---|
| Resolution: | → worksforme |
| Status: | new → closed |
Replying to sid:
To get this to work properly, I ran these commands:
trac-admin ~/trac-instances/test-0.11 priority add one trac-admin ~/trac-instances/test-0.11 priority add ""
When I run this:
trac-admin ~/trac-instances/test-0.11 priority order one down
I still get an error:
AssertionError: Cannot update priority with no name
There is a simple fix here - don't add a priority with no value. Propose closing as a
wontfix.
I used 0.12 stable to test this and couldn't reproduce it:
$ trac-admin test2 priority
Error: Command not found
priority add <value>
Add a priority value option
priority change <value> <newvalue>
Change a priority value
priority list
Show possible ticket priorities
priority order <value> up|down
Move a priority value up or down in the list
priority remove <value>
Remove a priority value
$ trac-admin test2 priority add one
$ trac-admin test2 priority order one down
$ trac-admin test2 priority order one up
$ trac-admin test2 priority add ""
TracError: Invalid priority name.
So I'm closing this as worksforme, please re-open if I misunderstood.
comment:10 by , 15 years ago
| Milestone: | next-major-0.1X |
|---|
Thijs, please remember to remove the milestone when you close tickets with a resolution different from "fixed".



When I ran that same command against trac 0.11b1, I got the usage message instead:
To get this to work properly, I ran these commands:
When I run this:
I still get an error:
There is a simple fix here - don't add a priority with no value. Propose closing as a
wontfix.