[issue22575] bytearray documentation confuses string for unicode objects

2014-10-10 Thread Terry J. Reedy
Terry J. Reedy added the comment: I changed the line to * If it is unicode, you must also give the encoding (and optionally, errors) parameters; bytearray() then converts the unicode to bytes using unicode.encode(). Thank you for the report, and for your work answering questions on SO --

[issue22575] bytearray documentation confuses string for unicode objects

2014-10-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0c75819f1d86 by Terry Jan Reedy in branch '2.7': Issue #22575: Revise bytearray entry for 2.7. https://hg.python.org/cpython/rev/0c75819f1d86 -- nosy: +python-dev ___ Python tracker

[issue22575] bytearray documentation confuses string for unicode objects

2014-10-07 Thread Martijn Pieters
New submission from Martijn Pieters: The Python 2 version of the bytearray() documentation appears to be copied directly from its Python 3 counterpart and states that when passing in a string an encoding is required: * If it is a string, you must also give the encoding (and optionally, errors)