Opened 8 months ago

Last modified 8 months ago

#14257 new defect

Python error with boxes in TRAC 1.6

Reported by: clemens Owned by: Mikael Relbe
Priority: normal Component: WikiExtrasPlugin
Severity: normal Keywords:
Cc: clemens Trac Release: 1.6


WikiExtrasPlugin has an problem with TRAC 1.6.

I have been using the great WikiExtrasPlugin under TRAC 1.4 for many years. Now after upgrading to TRAC 1.6 it does not run anymore. Might be a problem with the "boxes" component (

I am running the current version "1.3.2dev" i.e. revision r18475 of the plugin which is marked as "compatible with Python 3". My TRAC is the current 1.6 release, running under Linux (Debian 12) with Python 3.11.

Error message is logged as follows:

Trac[main] ERROR: [] Internal Server Error: <RequestWithSession "GET '/wikiextras/dynamicboxes.css'">, referrer 'http://localhost:8000/first/'
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/trac/web/", line 609, in dispatch_request
  File "/usr/local/lib/python3.11/dist-packages/trac/web/", line 301, in dispatch
    raise e
  File "/usr/local/lib/python3.11/dist-packages/trac/web/", line 247, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/local/lib/python3.11/dist-packages/tracwikiextras/", line 144, in process_request
    req.send(csstext, 'text/css', status=200)
  File "/usr/local/lib/python3.11/dist-packages/trac/web/", line 875, in send
    self._send(content, content_type, status)
  File "/usr/local/lib/python3.11/dist-packages/trac/web/", line 1011, in _send
  File "/usr/local/lib/python3.11/dist-packages/trac/web/", line 971, in write
    raise ValueError("Can't send str content")
ValueError: Can't send str content

Please note the in above error message. I found out that disabling the "boxes" component in WikiExtrasPlugin in trac.ini make the problem disappear. Hence I believe that there seems to be a problem with the "boxes" component.

tracwikiextras.phrases.aboutwikiphrases = enabled
tracwikiextras.phrases.phrases = enabled
tracwikiextras.boxes.aboutwikiboxes = disabled
tracwikiextras.boxes.boxes = enabled <<<<<<< "disabled" makes the problem go away
tracwikiextras.color.color = enabled
tracwikiextras.entities.entities = disabled
tracwikiextras.icons.aboutwikiicons = disabled
tracwikiextras.icons.icons = disabled
tracwikiextras.icons.showicons = disabled
tracwikiextras.icons.smileys = disabled
tracwikiextras.symbols.symbols = disabled
tracwikiextras.unc_paths.uncpathlink = disabled

Attachments (0)

Change History (3)

comment:1 Changed 8 months ago by clemens

Cc: clemens added

comment:2 Changed 8 months ago by Jun Omae

Try the following patch:

  • tracwikiextras/

    diff --git a/tracwikiextras/ b/tracwikiextras/
    index f8a853ec6..f911ffd5d 100755
    a b class Boxes(Component): 
    141141        else:
    142142            csstext += '.wiki-toc { width: auto !important; }\n'
     144        if not isinstance(csstext, bytes):
     145            csstext = csstext.encode('utf-8')
    144146        req.send(csstext, 'text/css', status=200)
    146148        return None

comment:3 in reply to:  2 Changed 8 months ago by clemens

Replying to Jun Omae:

The patch works. The error is gone. Good!

(Sorry for late reply. Currently I cannot receive e-mail notifications about ticket changes from Trac-Hacks. See my question in the mailing list...)


Modify Ticket

Change Properties
Set your email in Preferences
as new The owner will remain Mikael Relbe.

Add Comment

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

Note: See TracTickets for help on using tickets.