Modify

Opened 8 years ago

Closed 8 years ago

#3943 closed defect (wontfix)

AttributeError: 'str' object has no attribute 'rsplit'

Reported by: richard.cross@… Owned by: Jeff Hammel
Priority: high Component: TicketSubmitPolicyPlugin
Severity: major Keywords:
Cc: Trac Release: 0.11

Description

How to Reproduce

While doing a POST operation on /admin/ticket/policy, Trac issued an internal error.

Steps to reproduce:

  1. Go to Submit Policy in Admin area (Web frontend)
  2. Enter name in unlabelled text box and click "Add Policy" button
  3. Click either of the "+" buttons on the next screen and the error is thrown.

Obviously, this makes the admin interface completely useless.

Request parameters:

{'panel_id': u'policy', 'cat_id': u'ticket', 'add_condition_policy1': u'+', '__FORM_TOKEN': u'10d9980f6a6c7dbaf9804f3d', 'path_info': None, 'policy': u'policy1', 'new-policy': u'', 'add_action_policy1': u''}

User Agent was: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_5; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1

System Information

Trac 0.11
Python 2.3.4 (#1, Dec 11 2007, 05:28:55)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-9)]
setuptools 0.6c8
SQLite 3.3.6
pysqlite 1.1.7
Genshi 0.5
Pygments 0.9
Subversion 1.1.4 (r13838)
jQuery: 1.2.3

Python Traceback

Traceback (most recent call last):
  File "/usr/lib/python2.3/site-packages/Trac-0.11-py2.3.egg/trac/web/main.py", line 423, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.3/site-packages/Trac-0.11-py2.3.egg/trac/web/main.py", line 197, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/lib/python2.3/site-packages/Trac-0.11-py2.3.egg/trac/admin/web_ui.py", line 109, in process_request
    path_info)
  File "/usr/lib/python2.3/site-packages/TicketSubmitPolicy-0.7-py2.3.egg/ticketsubmitpolicy/ticketsubmitpolicy.py", line 371, in render_admin_panel
    args[policy][arg.rsplit(token, 1)[0]] = value
AttributeError: 'str' object has no attribute 'rsplit'

Attachments (1)

rsplit.diff (1.5 KB) - added by Jeff Hammel 8 years ago.
support rsplit for python 2.3

Download all attachments as: .zip

Change History (3)

comment:1 Changed 8 years ago by Jeff Hammel

python 2.3 strings don't have rsplit. please upgrade your python to 2.4 I've noted this on the TicketSubmitPolicyPlugin wiki page under Getting TicketSubmitPolicyPlugin

Changed 8 years ago by Jeff Hammel

Attachment: rsplit.diff added

support rsplit for python 2.3

comment:2 Changed 8 years ago by Jeff Hammel

Resolution: wontfix
Status: newclosed

http://trac-hacks.org/attachment/ticket/3943/rsplit.diff

You can try this patch wherein I've reimplemented the rsplit functionality for python 2.3. It doesn't really make sense to put this into the TicketSubmitPolicyPlugin code base as:

  1. its special cased to the two instances of rsplit in ticketsubmitpolicy.py
  2. it is code bloat for the normal (python >= 2.4) case

I don't plan on maintaining this patch in the future, so please upgrade, but in the mean time this should work (I hope)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jeff Hammel.
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.