Edgewall Software
Modify

Opened 13 years ago

Closed 13 years ago

Last modified 20 months ago

#10336 closed defect (fixed)

TypeError: plain() takes exactly 1 argument (2 given)

Reported by: mmarques@… Owned by: Remy Blank
Priority: high Milestone: plugin - mercurial
Component: plugin/mercurial Version: 0.11.7
Severity: critical Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

How to Reproduce

While doing a GET operation on /ticket/300, Trac issued an internal error.

(please provide additional details here)

Request parameters:

{'id': u'300'}

User Agent was: Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0 Iceweasel/5.0

System Information

Trac 0.11.7
Python 2.6.7 (r267:88850, Jul 10 2011, 10:13:11)
[GCC 4.6.1]
setuptools 0.6
psycopg2 2.4.2
Genshi 0.6
mod_python 3.3.1
Pygments 1.4
Mercurial 1.9.1
jQuery: 1.6.2

Python Traceback

Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/trac/web/main.py", line 450, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.6/dist-packages/trac/web/main.py", line 176, in dispatch
    chosen_handler)
  File "/usr/lib/python2.6/dist-packages/trac/web/main.py", line 296, in _pre_process_request
    chosen_handler = filter_.pre_process_request(req, chosen_handler)
  File "/usr/lib/python2.6/dist-packages/trac/versioncontrol/api.py", line 86, in pre_process_request
    self.get_repository(req.authname).sync()
  File "/usr/lib/python2.6/dist-packages/trac/versioncontrol/api.py", line 157, in get_repository
    repos = self._connector.get_repository(rtype, rdir, authname)
  File "/usr/lib/pymodules/python2.6/tracext/hg/backend.py", line 228, in get_repository
    self._setup_ui(self.config.get(type, 'hgrc'))
  File "/usr/lib/pymodules/python2.6/tracext/hg/backend.py", line 166, in _setup_ui
    self.ui = trac_ui(log=self.log)
  File "/usr/lib/pymodules/python2.6/tracext/hg/backend.py", line 272, in __init__
    ui.__init__(self, *args)
  File "/usr/lib/python2.6/dist-packages/mercurial/ui.py", line 44, in __init__
    self.readconfig(f, trust=True)
  File "/usr/lib/python2.6/dist-packages/mercurial/ui.py", line 96, in readconfig
    if self.plain('alias'):
TypeError: plain() takes exactly 1 argument (2 given)

Attachments (0)

Change History (7)

comment:1 by anonymous, 13 years ago

The buggy code is at line 96 of /usr/lib/python2.6/dist-packages/mercurial/ui.py:

if self.plain('alias'):

for k, v in cfg.items('alias'):

del cfgalias[k]

Eliminating those lines solves the problem.

The question is, what do they actually do?

comment:2 by Remy Blank, 13 years ago

This bug was already fixed in the 0.12 version of the plugin, but the fix wasn't backported. I'll do that.

comment:3 by Remy Blank, 13 years ago

Milestone: plugin - mercurial
Owner: set to Remy Blank

Backported Mercurial API compatibility fixes from 0.12 ([10698], [10697], [10748]) in [10791].

Could you please update to the latest version of the TracMercurial plugin and report back? Unfortunately, I don't have a 0.11 test setup ATM. If everything works well, I'll bump the patch number.

comment:4 by anonymous, 13 years ago

Just applied the patch to my server and looks like it's working OK.

Thanks alot.

comment:5 by Remy Blank, 13 years ago

Resolution: fixed
Status: newclosed

Thanks for testing.

comment:6 by spinor, 13 years ago

Milestone: plugin - mercurial
Resolution: fixed
Status: closedreopened
Version: 0.11.70.12-stable

Problem seems still to exist?

Mercurial: 2.0 Trac: 0.12.2 Python: 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] tracmercurial: 0.12.0.27 (and other versions)

in reply to:  6 comment:7 by Remy Blank, 13 years ago

Milestone: plugin - mercurial
Resolution: fixed
Status: reopenedclosed
Version: 0.12-stable0.11.7

Replying to spinor:

Problem seems still to exist?

Can you please open a new ticket for this, and provide the full traceback (and the system info you pasted above)? I suspect it's a new issue with Mercurial 2.0 that just happens to look similar.

Modify Ticket

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