[issue755660] allow HTMLParser to continue after a parse error

Francesco Frassinelli report at bugs.python.org
Tue Nov 10 13:47:10 CET 2009


Francesco Frassinelli <fraph24 at gmail.com> added the comment:

Site: http://ftp.vim.org/pub/vim/unstable/patches/

Outuput without error customized function:
[...]
  File "./takeit.py", line 54, in inspect
    parser.feed(data.read().decode())
  File "/home/frafra/Scrivania/takeit/html/parser.py", line 107, in feed
    self.goahead(0)
  File "/home/frafra/Scrivania/takeit/html/parser.py", line 163, in goahead
    k = self.parse_declaration(i)
  File "/usr/local/lib/python3.1/_markupbase.py", line 97, in
parse_declaration
    decltype, j = self._scan_name(j, i)
  File "/usr/local/lib/python3.1/_markupbase.py", line 387, in _scan_name
    % rawdata[declstartpos:declstartpos+20])
  File "/home/frafra/Scrivania/takeit/html/parser.py", line 122, in error
    raise HTMLParseError(message, self.getpos())
html.parser.HTMLParseError: expected name token at '<! gives an error
me', at line 153, column 48

Output with error customized function:
[...]
  File "./takeit.py", line 55, in inspect
    parser.feed(data.read().decode())
  File "/home/frafra/Scrivania/takeit/html/parser.py", line 107, in feed
    self.goahead(0)
  File "/home/frafra/Scrivania/takeit/html/parser.py", line 163, in goahead
    k = self.parse_declaration(i)
  File "/usr/local/lib/python3.1/_markupbase.py", line 97, in
parse_declaration
    decltype, j = self._scan_name(j, i)
TypeError: 'NoneType' object is not iterable

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue755660>
_______________________________________


More information about the Python-bugs-list mailing list