[Bug 357067] Re: javascript parsing error

Bug Watch Updater 357067 at bugs.launchpad.net
Tue Nov 1 16:57:41 UTC 2011


** Changed in: python
       Status: New => Fix Released

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

Title:
  javascript parsing error

Status in Beautiful Soup:
  Fix Released
Status in Python:
  Fix Released
Status in “beautifulsoup” package in Ubuntu:
  Fix Released
Status in “python2.6” package in Ubuntu:
  Triaged
Status in “python2.7” package in Ubuntu:
  Fix Released
Status in “beautifulsoup” package in Debian:
  Fix Released

Bug description:
  
  >>> 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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/beautifulsoup/+bug/357067/+subscriptions




More information about the foundations-bugs mailing list