[New-bugs-announce] [issue7820] parser: restores all bytes in the right order if check_bom() fails

STINNER Victor report at bugs.python.org
Sun Jan 31 04:24:23 CET 2010


New submission from STINNER Victor <victor.stinner at 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 <report at bugs.python.org>
<http://bugs.python.org/issue7820>
_______________________________________


More information about the New-bugs-announce mailing list