Opened 10 years ago

Closed 10 years ago

#2827 closed defect (duplicate)

TypeError: __init__() got an unexpected keyword argument 'req'

Reported by: chriss@… Owned by: Christophe de Vienne
Priority: high Component: PageToOdtPlugin
Severity: blocker Keywords:
Cc: Trac Release: 0.11


I get this error when I click on the OpenDocument link at the bottom of one of my wiki pages. I have installed the plugin correctly according to the installation instructions. I have installed:

  • ElementTree
  • cElementTree
  • The wiki page which describes the mapping of styles within the ODT, and
  • The Open Document Template has been uploaded to that page as well

I think I can see the problem, in

    def __init__(self, env, req=None, absurls=False, db=None, styles=None):
        Formatter.__init__(self, env, req=None, absurls=False, db=None)
        self.styles = styles
        self._in_list_item = False

However the code for the Formatter.init() call reads as follow:

class Formatter(object):
    """Base Wiki formatter.

    Parses and formats wiki text, in a given `Context`.
    flavor = 'default'

    # 0.10 compatibility

    def __init__(self, env, context):
        """Note: `req` is still temporarily used."""
        self.env = env
        self.context = context
        self.req = context.req
        self.href = context.href
        self.resource = context.resource
        self.perm = context.perm
        self.db = self.env.get_db_cnx() # FIXME: remove = WikiSystem(self.env)
        self.wikiparser = WikiParser(self.env)
        self._anchors = {}
        self._open_tags = []

I guess Trac 0.11 is expecting the 'req' parameter to be part of a context object not as a separate parameter.

Attachments (0)

Change History (1)

comment:1 Changed 10 years ago by Christophe de Vienne

Resolution: duplicate
Status: newclosed


0.11 is not yet supported in the svn. There is a patch here : #1950



Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Christophe de Vienne.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.