[issue44929] Some RegexFlag cannot be printed in the repr

2021-08-27 Thread Łukasz Langa
Łukasz Langa added the comment: repr(re.RegexFlag(0)) no longer crashes so we can close this. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue44929] Some RegexFlag cannot be printed in the repr

2021-08-25 Thread Ethan Furman
Ethan Furman added the comment: New changeset 24da544014f78e6f1440d5ce5c2d14794a020340 by Pablo Galindo Salgado in branch 'main': bpo-44929: [Enum] Fix global repr (GH-27789) https://github.com/python/cpython/commit/24da544014f78e6f1440d5ce5c2d14794a020340 --

[issue44929] Some RegexFlag cannot be printed in the repr

2021-08-18 Thread Ethan Furman
Ethan Furman added the comment: `_name_` is only None if the entire enum value is outside any named member and `_boundary_` is `KEEP` -- so class Example(Flag, boundary=KEEP): first = auto() second = auto() third = auto() >>> Example(0) module.Example(0)

[issue44929] Some RegexFlag cannot be printed in the repr

2021-08-18 Thread Łukasz Langa
Łukasz Langa added the comment: Ethan, could you take a look at the PR? I added a few failing test methods since `repr` handling for global enum flags wasn't covered and looks unfinished. If you tell us what the expected return values should be, I'll finish the fix. -- nosy:

[issue44929] Some RegexFlag cannot be printed in the repr

2021-08-16 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +26258 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27789 ___ Python tracker

[issue44929] Some RegexFlag cannot be printed in the repr

2021-08-16 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: This looks incorrect: https://github.com/python/cpython/blob/1512bc21d60f098a9e9f37b44a2f6a9b49a3fd4f/Lib/enum.py#L1399 -- ___ Python tracker

[issue44929] Some RegexFlag cannot be printed in the repr

2021-08-16 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Simpler reproducer: >>> import re >>> re.RegexFlag(0) Traceback (most recent call last): File "", line 1, in File "/home/pablogsal/github/cpython/Lib/enum.py", line 1399, in global_flag_repr return "%x" % (module, cls_name, self._value_)

[issue44929] Some RegexFlag cannot be printed in the repr

2021-08-16 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: (Deleted last message because it was incorrect) -- ___ Python tracker ___ ___

[issue44929] Some RegexFlag cannot be printed in the repr

2021-08-16 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- Removed message: https://bugs.python.org/msg399689 ___ Python tracker ___ ___ Python-bugs-list

[issue44929] Some RegexFlag cannot be printed in the repr

2021-08-16 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Same happens when printing a enum.Flag with some values: >>> enum.Flag(1) Traceback (most recent call last): File "", line 1, in File "/home/pablogsal/github/cpython/Lib/enum.py", line 597, in __call__ return cls.__new__(cls, value)

[issue44929] Some RegexFlag cannot be printed in the repr

2021-08-16 Thread Pablo Galindo Salgado
New submission from Pablo Galindo Salgado : 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 "", line 1, in