Edgewall Software
Modify

Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#11097 closed defect (fixed)

Use of deprecated env.get_version(db) in trac core

Reported by: ethan.jucovy@… Owned by: ethan.jucovy@…
Priority: normal Milestone: 1.0.2
Component: general Version:
Severity: minor Keywords:
Cc: Branch:
Release Notes:

In EnvironmentSetup.environment_needs_upgrade, removed deprecated and unused db parameter from call to Environment.get_version.

API Changes:
Internal Changes:

Description

The docstring for Environment.get_version in trac/env.py states:

        :since 1.0: deprecation warning: the `db` parameter is no                                                                                                               
                    longer used and will be removed in version 1.1.1                                                                                                            
        """

However, code in trac/env.py on trunk calls get_version(db).

The following patch removes the deprecated db argument in the function call. Trac's tests still pass after this patch is applied.

  • trac/env.py

    diff --git a/trac/env.py b/trac/env.py
    index b63653b..d2d42b0 100644
    a b class EnvironmentSetup(Component):  
    754754        self._update_sample_config()
    755755
    756756    def environment_needs_upgrade(self, db):
    757         dbver = self.env.get_version(db)
     757        dbver = self.env.get_version()
    758758        if dbver == db_default.db_version:
    759759            return False
    760760        elif dbver > db_default.db_version:

This is the only place in Trac core code where the old signature is used — all other calls to env.get_version do not pass in the db argument.

Attachments (0)

Change History (4)

comment:1 by Christian Boos, 12 years ago

Milestone: 1.0.2

Good catch! It's always better to be consistent…

comment:2 by Ryan J Ollos, 11 years ago

Resolution: fixed
Status: newclosed

Committed to 1.0-stable in [11981] and merged to trunk in [11982].

Thanks Ethan!

comment:3 by Ryan J Ollos, 11 years ago

Owner: set to ethan.jucovy@…

comment:4 by Ryan J Ollos, 11 years ago

Release Notes: modified (diff)

Modify Ticket

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