Modify

Opened 7 years ago

Closed 7 years ago

#2827 closed defect (duplicate)

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

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

Description

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 odtformatter.py:

    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
    INTERTRAC_SCHEME = WikiParser.INTERTRAC_SCHEME
    QUOTED_STRING = WikiParser.QUOTED_STRING
    LINK_SCHEME = WikiParser.LINK_SCHEME

    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
        self.wiki = 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 7 years ago by cdevienne

  • Resolution set to duplicate
  • Status changed from new to closed

Hi,

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

Regards,

Christophe

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.