[New-bugs-announce] [issue44929] Some RegexFlag cannot be printed in the repr

Pablo Galindo Salgado report at bugs.python.org
Mon Aug 16 18:03:59 EDT 2021


New submission from Pablo Galindo Salgado <pablogsal at gmail.com>:

When printing some instance of RegexFlag **in the REPL** it fails to print:

>>> import gc
# This prints a ton of objects, including the bad enum RegexFlag one
>>> gc.get_referrers(None) 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pablogsal/github/cpython/Lib/enum.py", line 1399, in global_flag_repr
    return "%x" % (module, cls_name, self._value_)
           ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TypeError: %x format: an integer is required, not str

----------
messages: 399688
nosy: ethan.furman, pablogsal
priority: normal
severity: normal
status: open
title: Some RegexFlag cannot be printed in the repr
versions: Python 3.10, Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44929>
_______________________________________


More information about the New-bugs-announce mailing list