[New-bugs-announce] [issue15379] Charmap decoding of no-BMP characters

Serhiy Storchaka report at bugs.python.org
Tue Jul 17 10:15:58 CEST 2012


New submission from Serhiy Storchaka <storchaka at gmail.com>:

Yet one inconsistency in charmap codec.

>>> import codecs
>>> codecs.charmap_decode(b'\x00', 'strict', '\U0002000B')
('𠀋', 1)
>>> codecs.charmap_decode(b'\x00', 'strict', {0: '\U0002000B'})
('𠀋', 1)
>>> codecs.charmap_decode(b'\x00', 'strict', {0: 0x2000B})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: character mapping must be in range(65536)

The suggested patch removes this unnecessary limitation in charmap decoder.

----------
components: Interpreter Core
files: decode_charmap_maxchar.patch
keywords: patch
messages: 165688
nosy: storchaka
priority: normal
severity: normal
status: open
title: Charmap decoding of no-BMP characters
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file26412/decode_charmap_maxchar.patch

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


More information about the New-bugs-announce mailing list