Edgewall Software
Modify

Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#4967 closed defect (duplicate)

internal error when displaying .sql attachment

Reported by: anonymous Owned by: Christian Boos
Priority: normal Milestone:
Component: version control/browser Version: 0.10.3.1
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

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 (1)

test.sql (73 bytes ) - added by anonymous 17 years ago.

Download all attachments as: .zip

Change History (6)

by anonymous, 17 years ago

Attachment: test.sql added

comment:1 by anonymous, 17 years ago

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

The attachment may be downloaded directly here:

test.sql

comment:2 by anonymous, 17 years ago

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.

comment:3 by Christian Boos, 17 years ago

Resolution: duplicate
Status: newclosed

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.

comment:4 by anonymous, 17 years ago

thanks. i should have searched more carefully.

ticket:4931 is related to SMTP and TLS?

comment:5 by Christian Boos, 17 years ago

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

Modify Ticket

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