This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mjpieters
Recipients docs@python, mjpieters
Date 2014-10-07.17:34:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1412703260.19.0.077276076378.issue22575@psf.upfronthosting.co.za>
In-reply-to
Content
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) parameters; bytearray() then converts the string to bytes using str.encode().

(from https://docs.python.org/2/library/functions.html#bytearray).

This obviously doesn't apply to Python 2 str() objects, but would only apply to unicode() objects.

Can this be corrected? The current wording is confusing new users (see http://stackoverflow.com/questions/26230745/how-to-convert-python-str-to-bytearray).
History
Date User Action Args
2014-10-07 17:34:20mjpieterssetrecipients: + mjpieters, docs@python
2014-10-07 17:34:20mjpieterssetmessageid: <1412703260.19.0.077276076378.issue22575@psf.upfronthosting.co.za>
2014-10-07 17:34:20mjpieterslinkissue22575 messages
2014-10-07 17:34:19mjpieterscreate