Modify

Opened 3 years ago

Last modified 3 years ago

#13927 accepted task

Trac 1.5.2 compatibility

Reported by: anonymous Owned by: Ryan J Ollos
Priority: normal Component: WikiExtrasPlugin
Severity: normal Keywords: Trac1.5.2 patch
Cc: Trac Release:

Description

Plugin does not work with Trac 1.5.2 anymore:

ImportError: cannot import name 'cleandoc' from 'trac.util.compat' 

Trac 1.5.2 removed trac.util.compat.cleandoc (t:ticket:11600, changeset:17483).

Solution: Switch to trac.util.text.cleandoc instead in color.py, boxes.py, icons.py and phrases.py.


ImportError: cannot import name 'sorted' from 'trac.util.compat'

Solution: Remove that line.

Now the plugin loads. However it still does not work: Any page request gets stuck forever somewhere.

Attachments (1)

wikiextras_T13927.patch (6.8 KB) - added by anonymous 3 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 3 years ago by Ryan J Ollos

Type: defecttask

Plugin needs to be ported to Python 3.

Changed 3 years ago by anonymous

Attachment: wikiextras_T13927.patch added

comment:2 Changed 3 years ago by anonymous

I tried running 2to3 on the plugin but it still did not work.

I then changed csstext to csstext.encode('utf-8') on this line and that solved the problem.

Attached full patch.

comment:3 in reply to:  2 ; Changed 3 years ago by anonymous

I then changed csstext to csstext.encode('utf-8') on this line and that solved the problem.

Fixed link to the right line.

comment:4 Changed 3 years ago by Ryan J Ollos

Owner: changed from Mikael Relbe to Ryan J Ollos
Status: newaccepted

comment:5 Changed 3 years ago by figaro

Keywords: patch added

comment:6 in reply to:  3 Changed 3 years ago by anonymous

changed csstext to csstext.encode('utf-8') on this line and that solved the problem.

Similar to Trac wiki code, Trac ticket code, ... maybe required because of Trac code here? I never got a ValueError("Can't send str content") though.

(That Trac code looks strange actually: How can isinstance(content, str) be relevant in _send for Content-Length, when it then calls write(content) which (supposedly) raises (or gets stuck in practice) in that case?)

Anyway, applying the patch above would fix the plugin.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as accepted The owner will remain Ryan J Ollos.

Add Comment


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

 
Note: See TracTickets for help on using tickets.