Edgewall Software
Modify

Opened 14 years ago

Closed 14 years ago

#10078 closed defect (fixed)

Improper use of property() in env.py

Reported by: anonymous Owned by: Remy Blank
Priority: high Milestone: 0.12.3
Component: general Version:
Severity: minor Keywords:
Cc: joshua@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

This code:

from trac.web.href import Href
from trac.env import open_environment

env = open_environment('/path/to/trac')
env.href = Href(u'https://example.com/trac/')

Creates this traceback:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'str' object is not callable

This is because of this line at http://trac.edgewall.org/browser//trunk/trac/env.py#L665

href = property(_get_href, 'The application root path')

The docs at http://docs.python.org/library/functions.html#property state that the doc string should be the fourth parameter, not the second parameter.

Same error on line 676 as well. All usages of property() should probably be checked.

Attachments (0)

Change History (2)

comment:1 by Remy Blank, 14 years ago

Milestone: 0.12.3
Owner: set to Remy Blank
Severity: normalminor

Yes, that's plain wrong. Thanks for the heads-up.

comment:2 by Remy Blank, 14 years ago

Resolution: fixed
Status: newclosed

Fixed in [10639].

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.