Edgewall Software
Modify

Opened 4 years ago

Closed 4 years ago

#12151 closed defect (fixed)

AttributeError is raised by hdfdump=1 parameter

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 1.0.9
Component: rendering Version: 1.0.8
Severity: normal Keywords:
Cc: Branch:
Release Notes:

Fix AttributeError raising with hdfdump parameter.

API Changes:

Description

This issue is introduced in [14186] (#12131).

2015-08-05 16:59:05,888 Trac[main] ERROR: Internal Server Error:
Traceback (most recent call last):
  File "/venv/trac/1.0.8/lib/python2.5/site-packages/trac/web/main.py", line 551, in _dispatch_request
    dispatcher.dispatch(req)
  File "/venv/trac/1.0.8/lib/python2.5/site-packages/trac/web/main.py", line 258, in dispatch
    out = StringIO.StringIO()
AttributeError: class StringIO has no attribute 'StringIO'
  • trac/web/main.py

    diff --git a/trac/web/main.py b/trac/web/main.py
    index 909d75ec0..e01f91083 100644
    a b import pkg_resources  
    2727from pprint import pformat, pprint
    2828import re
    2929import sys
    30 import StringIO
    3130
    3231from genshi.builder import tag
    3332from genshi.output import DocType
    class RequestDispatcher(Component):  
    255254                    if 'hdfdump' in req.args:
    256255                        req.perm.require('TRAC_ADMIN')
    257256                        # debugging helper - no need to render first
    258                         out = StringIO.StringIO()
     257                        out = StringIO()
    259258                        pprint(data, out)
    260259                        req.send(out.getvalue(), 'text/plain')
    261260

Attachments (0)

Change History (5)

comment:1 by Ryan J Ollos, 4 years ago

Instead we could just backport the fix in [14214]. I guess that could affect a plugin if it was relying on a transitive import. Worst case though any issues with a plugin are discovered and easily fixed in a backward compatible way.

comment:2 by Jun Omae, 4 years ago

Owner: set to Jun Omae
Status: newassigned

Okay. In jomae.git@t12151, backport of r14214 and unit tests for hdfdump.

comment:3 by Ryan J Ollos, 4 years ago

Thanks for fixing this. The change looks good.

comment:4 by Ryan J Ollos, 4 years ago

Summary: AttributeError is raiesd by hdfdump=1 parameterAttributeError is raissd by hdfdump=1 parameter

comment:5 by Jun Omae, 4 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed
Summary: AttributeError is raissd by hdfdump=1 parameterAttributeError is raised by hdfdump=1 parameter

Thanks for the reviewing. Committed in [14221,14223] and merged to trunk in [14222,14224].

Modify Ticket

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