[New-bugs-announce] [issue27474] Unify exception in _Py_bytes_contains for integers

Xiang Zhang report at bugs.python.org
Sat Jul 9 13:42:39 EDT 2016


New submission from Xiang Zhang:

Now, `sys.maxsize+1 in b'foo'` raises "TypeError: 'int' does not support the buffer interface" which seems weird. In such case, I don't think there is any difference between sys.maxsize+1 and 256. So I suggest make it emits the same exceptions as `256 in b'foo'`, "ValueError: byte must be in range(0, 256)".

----------
files: _Py_bytes_contains.patch
keywords: patch
messages: 270058
nosy: serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
status: open
title: Unify exception in _Py_bytes_contains for integers
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file43668/_Py_bytes_contains.patch

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


More information about the New-bugs-announce mailing list