Edgewall Software
Modify

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#12179 closed defect (cantfix)

TypeError: unsupported operand type(s) for +=: 'int' and 'unicode'

Reported by: sshukla Owned by:
Priority: normal Milestone:
Component: general Version: 1.0.5
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

How to Reproduce

While doing a POST operation on /changeset/676/source, Trac issued an internal error.

(please provide additional details here)

Request parameters:

{'__FORM_TOKEN': u'6b77fcad66bca7d78b433f15',
 'new': u'676',
 'new_path': u'/source',
 'reviewbutton': u'Submit review',
 'status': u'PENDING',
 'summary': u'ss'}

User agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0

System Information

Trac 1.0.5
Genshi 0.7 (without speedups)
MySQL server: "5.6.23-log", client: "5.1.73", thread-safe: 1
MySQLdb 1.2.5
Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)]
setuptools 15.0
Subversion 1.6.16 (r1073529)
jQuery 1.7.2
jQuery UI 1.8.21
jQuery Timepicker 1.0.1

Enabled Plugins

remote-user-auth N/A
TracAccountManager 0.4.4
TracCodeReviewer 1.0.0.dev0
TracHtmlNotificationPlugin 0.12.0.1

Python Traceback

Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 513, in _dispatch_request
    dispatcher.dispatch(req)
  File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 232, in dispatch
    self._post_process_request(req, *resp)
  File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 347, in _post_process_request
    resp = f.post_process_request(req, *resp)
  File "build/bdist.linux-x86_64/egg/coderev/web_ui.py", line 78, in post_process_request
    self._update_tickets(review, status_changed)
  File "build/bdist.linux-x86_64/egg/coderev/web_ui.py", line 132, in _update_tickets
    disp_ref += '/' + review.repo
TypeError: unsupported operand type(s) for +=: 'int' and 'unicode'

Attachments (0)

Change History (7)

comment:1 by Jun Omae, 9 years ago

Component: plugin/spamfiltergeneral
Resolution: cantfix
Status: newclosed

comment:2 by Jun Omae, 9 years ago

Owner: Dirk Stöcker removed

comment:3 by Ryan J Ollos, 9 years ago

Please update to the latest code revision before reporting the issue to th:CodeReviewerPlugin.

comment:4 by Jun Omae, 9 years ago

For Subversion, short_rev() returns int. So, I suppose that issue happens when target repository is a Subversion repository and non-default.

            repos = RepositoryManager(self.env).get_repository(review.repo)
            ref = review.changeset
            disp_ref = repos.short_rev(review.changeset)
            if review.repo:
                ref += '/' + review.repo
                disp_ref += '/' + review.repo
            comment += ' for [changeset:"%s" %s]' % (ref, disp_ref)
-            disp_ref = repos.short_rev(review.changeset)
+            disp_ref = str(repos.short_rev(review.changeset))

comment:5 by Ryan J Ollos, 9 years ago

Thanks, fixed in [th 14888].

It might be better to have short_rev always return a string for API consistency. It is confusing when implementations of the interface returns different types.

in reply to:  5 comment:6 by Jun Omae, 9 years ago

It might be better to have short_rev always return a string for API consistency.

Sounds good. Repository.display_rev has the same issue.

comment:7 by Ryan J Ollos, 9 years ago

Thanks. I created #12182 to discuss the API change.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) 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.