[issue23231] Fix codecs.iterencode/decode() by allowing data parameter to be omitted

Martin Panter report at bugs.python.org
Tue Jan 13 13:48:20 CET 2015


New submission from Martin Panter:

As mentioned in Issue 20132, iterencode() and iterdecode() only work on text-to-byte codecs, because they assume particular data types when finalizing the incremental codecs. This patch changes the signature of the IncrementalEncoder and IncrementalDecoder methods from

IncrementalEncoder.encode(object[, final])
IncrementalEncoder.decode(object[, final])

to

IncrementalEncoder.encode([object,] [final])
IncrementalEncoder.decode([object,] [final])

so that iteren/decode(), and perhaps in the future, StreamWriter/Reader, can operate the incremental codec without knowing what kind of data should be processed.

----------
components: Library (Lib), Unicode
files: final-no-object.patch
keywords: patch
messages: 233932
nosy: ezio.melotti, haypo, vadmium
priority: normal
severity: normal
status: open
title: Fix codecs.iterencode/decode() by allowing data parameter to be omitted
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file37691/final-no-object.patch

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


More information about the Python-bugs-list mailing list