Message314453
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' |
|
Date |
User |
Action |
Args |
2018-03-26 13:49:48 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, lemburg, vstinner, ezio.melotti, docs@python, martin.panter |
2018-03-26 13:49:48 | serhiy.storchaka | set | messageid: <1522072188.34.0.467229070634.issue24024@psf.upfronthosting.co.za> |
2018-03-26 13:49:48 | serhiy.storchaka | link | issue24024 messages |
2018-03-26 13:49:48 | serhiy.storchaka | create | |
|