New submission from Dan Snider <mr.assume.a...@gmail.com>:

I've tested it on at least one of each minor version since 3.4 but it looks 
like it may be specific to 3.6.0. The developer's guide isn't clear enough for 
me to understand what's eligible for bug fixes but since I'm not sure if it 
actually is 3.6.0 exclusive I'll post it just in case.

Here's how to cause it:

if 1:
    class Bytes(bytes):
        def __new__(cls, name, encoding='ascii'):
            return bytes.__new__(cls, name.encode())
        __repr__ = bytes.decode
    print(repr(Bytes("LOAD_NAME")))

Traceback (most recent call last):
  File "<stdin>", line 6, in <module>
SystemError: <built-in function displayhook> returned NULL without setting an 
error

----------
messages: 327015
nosy: bup
priority: normal
severity: normal
status: open
title: bytes subclass __repr__ raise SystemError when set to bytes.decode
versions: Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34887>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to