Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment: The current docstring is correct. The signature str(object, encoding="utf-8", errors="strict") is not correct, because str(object) is not the same as str(object, encoding="utf-8", errors="strict").
>>> str([1, 2]) '[1, 2]' >>> str([1, 2], encoding="utf-8", errors="strict") Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: decoding to str: need a bytes-like object, list found >>> str(b'abc') __main__:1: BytesWarning: str() on a bytes instance "b'abc'" >>> str(b'abc', encoding="utf-8", errors="strict") 'abc' ---------- nosy: +serhiy.storchaka status: open -> pending _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue24024> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com