[Bug 357067] [NEW] javascript parsing error

Launchpad Bug Tracker 357067 at bugs.launchpad.net
Thu May 26 09:38:09 UTC 2011


You have been subscribed to a public bug:


>>> p = """
... <HTML>
...     <HEAD>
...     </HEAD>
... <BODY>        
... <script type=text/javascript>        
... rgvij="></if";
... </script>
... </BODY>
... </html>
... """
>>> soup = BeautifulSoup(p)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'BeautifulSoup' is not defined
>>> from BeautifulSoup import BeautifulSoup
>>> soup = BeautifulSoup(p)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/arthur/honeynet/code/js_decode/python/lib/python2.5/site-packages/BeautifulSoup.py", line 1499, in __init__
    'th' : ['tr'],
  File "/Users/arthur/honeynet/code/js_decode/python/lib/python2.5/site-packages/BeautifulSoup.py", line 1230, in __init__
    """We need to pop up to the previous tag of this type, unless
  File "/Users/arthur/honeynet/code/js_decode/python/lib/python2.5/site-packages/BeautifulSoup.py", line 1263, in _feed
    #If we encounter one of the nesting reset triggers
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/HTMLParser.py", line 108, in feed
    self.goahead(0)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/HTMLParser.py", line 150, in goahead
    k = self.parse_endtag(i)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/HTMLParser.py", line 314, in parse_endtag
    self.error("bad end tag: %r" % (rawdata[i:j],))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/HTMLParser.py", line 115, in error
    raise HTMLParseError(message, self.getpos())
HTMLParser.HTMLParseError: bad end tag: u'</if";\n</script>', at line 7, column 9
>>> 

This works correctly in 3.0.x series.

** Affects: beautifulsoup
     Importance: Undecided
         Status: Fix Released

** Affects: python
     Importance: Unknown
         Status: New

** Affects: beautifulsoup (Ubuntu)
     Importance: Low
         Status: Fix Released

** Affects: python2.6 (Ubuntu)
     Importance: Low
         Status: Triaged

** Affects: beautifulsoup (Debian)
     Importance: Unknown
         Status: Fix Released

-- 
javascript parsing error
https://bugs.launchpad.net/bugs/357067
You received this bug notification because you are a member of Ubuntu Foundations Bugs, which is subscribed to python2.6 in Ubuntu.




More information about the foundations-bugs mailing list