New submission from STINNER Victor <victor.stin...@haypocalc.com>:

My patch fixes check_bom() to restore all bytes in the right order if there is 
no BOM to leave the stream unchanged and to fix an assertion error in 
buf_ungetc() (raised in pydebug mode).

The current code only unget one byte (0xFF), even if two or three bytes are 
read. I suppose that check_bom() writes any non-ASCII byte, because such byte 
will raise a SyntaxError.

----------
files: parser_restore_bom.patch
keywords: patch
messages: 98599
nosy: haypo
severity: normal
status: open
title: parser: restores all bytes in the right order if check_bom() fails
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file16067/parser_restore_bom.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7820>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to