Edgewall Software
Modify

Opened 16 years ago

Closed 13 years ago

Last modified 13 years ago

#6560 closed defect (worksforme)

trac-admin bug with empty priority names

Reported by: gnuyoga@… 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 Christian Boos)

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)

comment:1 by sid, 16 years ago

When I ran that same command against trac 0.11b1, I got the usage message instead:

trac-admin ~/trac-instances/test-0.11 priority add one priority add "" priority order one down

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.

in reply to:  1 ; comment:2 by Emmanuel Blot, 16 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.

in reply to:  2 comment:3 by anonymous, 16 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 osimons, 16 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 Christian Boos, 16 years ago

Description: modified (diff)
Milestone: 0.12

Like manu said in comment:2, should be a small fix.

comment:6 by Christian Boos, 15 years ago

Keywords: verify added
Summary: trac-admin bugtrac-admin bug with empty priority names

in reply to:  2 comment:7 by Thijs Triemstra <lists@…>, 14 years ago

Cc: lists@… added
Severity: minormajor

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 Thijs Triemstra, 13 years ago

Cc: Thijs Triemstra added; lists@… removed

in reply to:  1 comment:9 by Thijs Triemstra, 13 years ago

Keywords: verify removed
Resolution: worksforme
Status: newclosed

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 Remy Blank, 13 years ago

Milestone: next-major-0.1X

Thijs, please remember to remove the milestone when you close tickets with a resolution different from "fixed".

comment:11 by Thijs Triemstra, 13 years ago

Sure thing rblank, thanks for the heads up.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christopher Lenz.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christopher Lenz to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.