Edgewall Software
Modify

Opened 12 years ago

Closed 11 years ago

Last modified 10 years ago

#11023 closed enhancement (fixed)

Polymorphic access to section methods when calling Option accessor

Reported by: Olemis Lang <olemis+trac@…> Owned by: Olemis Lang <olemis+trac@…>
Priority: normal Milestone: 1.0.2
Component: general Version: 1.0-stable
Severity: minor Keywords: bloodhound configuration option descriptor polymorphism
Cc: Branch:
Release Notes:
API Changes:

Section accessors can be overridden in classes that inherit from the Option class and its derivatives.

Internal Changes:

Description

Subclasses of trac.config.Configuration have been implemented for Apache™ Bloodhound multi-product support . They store settings in the database instead of .ini files . They satisfy expected behavior since [ Trac config tests will pass]. Nonetheless some errors have been detected while using them together with Option descriptors .

The root cause is that trac.config.Option.accessor is set to unbound method trac.config.Section.get . This very same method is overriden by our sub-classes. Therefore Option.__get__ under the new circumstances will always fail because the more specialized method is never invoked.

Hence I'm proposing this patch to be committed upstream in order to enable method polymorphism on Section instances as a consequence of invoking Option.__get__ .

Attachments (0)

Change History (6)

comment:1 by Ryan J Ollos <ryan.j.ollos@…>, 12 years ago

Cc: ryan.j.ollos@… added

comment:2 by Christian Boos, 12 years ago

Milestone: 1.0.2

Looks harmless.

comment:3 by Ryan J Ollos, 11 years ago

Cc: ryan.j.ollos@… removed
Owner: set to Ryan J Ollos
Status: newassigned

Okay, I think I understand now. Unit tests still pass with Python 2.5 and 2.7, and this doesn't seem to break anything. Changes have been prepared for commit in rjollos.git:t11023.

comment:4 by Ryan J Ollos, 11 years ago

API Changes: modified (diff)
Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed to 1.0-stable in [11991], and merged to trunk in [11992].

Thanks Olemis!

comment:5 by Ryan J Ollos, 11 years ago

Owner: changed from Ryan J Ollos to Olemis Lang <olemis+trac@…>

comment:6 by Ryan J Ollos, 10 years ago

API Changes: modified (diff)
Release Notes: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Olemis Lang <olemis+trac@…>.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Olemis Lang <olemis+trac@…> 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.