Edgewall Software

Ticket #4967 (closed defect: duplicate)

Opened 21 months ago

Last modified 21 months ago

internal error when displaying .sql attachment

Reported by: anonymous Owned by: cboos
Priority: normal Milestone:
Component: version control/browser Version: 0.10.3.1
Severity: normal Keywords:
Cc:

Description

Trac returns an internal error when rendering a .sql attachment containing the following SQL statement:

INSERT INTO `somedb` VALUES ('<a "http://trac.edgewall.org">trac</a>');

I think this is valid SQL?

The error:

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 387, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 244, in dispatch
    req.display(template, content_type or 'text/html')
  File "/usr/lib/python2.4/site-packages/trac/web/api.py", line 358, in display
    data = self.hdf.render(template, form_token)
  File "/usr/lib/python2.4/site-packages/trac/web/clearsilver.py", line 296, in render
    injector.feed(template.render())
  File "/usr/lib/python2.4/HTMLParser.py", line 108, in feed
    self.goahead(0)
  File "/usr/lib/python2.4/HTMLParser.py", line 150, in goahead
    k = self.parse_endtag(i)
  File "/usr/lib/python2.4/HTMLParser.py", line 314, in parse_endtag
    self.error("bad end tag: %r" % (rawdata[i:j],))
  File "/usr/lib/python2.4/HTMLParser.py", line 115, in error
    raise HTMLParseError(message, self.getpos())
HTMLParseError: bad end tag: '</a">', at line 55, column 282

Attachments

test.sql (73 bytes) - added by anonymous 21 months ago.

Change History

Changed 21 months ago by anonymous

Changed 21 months ago by anonymous

The above link to the attachment page returns the same error.

The attachment may be downloaded directly here:

test.sql

Changed 21 months ago by anonymous

the following can be attached as both test.txt and test.sql:

'<a href="https://"></a>'

the following can only be attached as test.txt:

'<a href="http://"></a>'

changing https to http prevents rendering as test.sql.

Changed 21 months ago by cboos

  • status changed from new to closed
  • resolution set to duplicate

Well, this is a known problem with 0.10.1 onwards, a side-effect of #4931.

Broken HTML produced by (broken) syntax highlighters can't be parsed and will trigger such an error. This is similar to the problem already reported in #4365.

Changed 21 months ago by anonymous

thanks. i should have searched more carefully.

ticket:4931 is related to SMTP and TLS?

Changed 21 months ago by cboos

Oops, got the reference totally wrong, sorry: I meant a side-effect of #4049 (#4931 has nothing to do with the issue).

Add/Change #4967 (internal error when displaying .sql attachment)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from cboos. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.