https://bugzilla.redhat.com/show_bug.cgi?id=2069709
Bug ID: 2069709
Summary: python-stack-data fails to build with Python 3.11:
executing.executing.NotOneValueFound: Expected one
value, found 0
Product: Fedora
Version: rawhide
Status: NEW
Component: python-stack-data
Assignee: lbalhar(a)redhat.com
Reporter: thrnciar(a)redhat.com
CC: epel-packagers-sig(a)lists.fedoraproject.org,
lbalhar(a)redhat.com, mhroncok(a)redhat.com,
michel(a)michel-slm.name, thrnciar(a)redhat.com
Blocks: 2016048 (PYTHON3.11)
Target Milestone: ---
Classification: Fedora
python-stack-data fails to build with Python 3.11.0a6.
=================================== FAILURES
===================================
_________________________________ test_example
_________________________________
def test_example():
from .samples.example import bar
result = bar()
tests/test_core.py:573:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/samples/example.py:27: in bar
exec("result = foo()", globals(), names)
<string>:1: in <module>
???
tests/samples/example.py:20: in foo
result = print_stack(
tests/samples/example.py:35: in print_stack
for frame_info in list(FrameInfo.stack_data(frame, options))[-3:]:
/usr/lib/python3.11/site-packages/typeguard/__init__.py:897: in __next__
return self.send(None)
/usr/lib/python3.11/site-packages/typeguard/__init__.py:915: in send
value = self.__wrapped.send(obj)
stack_data/core.py:565: in stack_data
yield from collapse_repeated(
stack_data/utils.py:84: in collapse_repeated
yield from map(mapper, original_group)
stack_data/core.py:555: in mapper
return cls(f, options)
/usr/lib/python3.11/site-packages/typeguard/__init__.py:1033: in wrapper
retval = func(*args, **kwargs)
stack_data/core.py:520: in __init__
self.executing = Source.executing(frame_or_tb)
/usr/lib/python3.11/site-packages/executing/executing.py:335: in executing
node = find_node(lasti)
/usr/lib/python3.11/site-packages/executing/executing.py:321: in find_node
return only(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
it = <generator object
Source.executing.<locals>.find_node.<locals>.<genexpr>
at 0x7f8a614b36a0>
def only(it):
if hasattr(it, '__len__'):
if len(it) != 1:
raise NotOneValueFound('Expected one value, found %s' %
len(it))
# noinspection PyTypeChecker
return list(it)[0]
lst = tuple(islice(it, 2))
if len(lst) == 0:
raise NotOneValueFound('Expected one value, found
0')
E executing.executing.NotOneValueFound: Expected one value, found
0
/usr/lib/python3.11/site-packages/executing/executing.py:164: NotOneValueFound
____________________________ test_pygments_example
_____________________________
def test_pygments_example():
from .samples.pygments_example import bar
result = bar()
tests/test_core.py:618:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/samples/pygments_example.py:17: in bar
@deco
tests/samples/pygments_example.py:26: in deco
f.result = print_stack()
tests/samples/pygments_example.py:43: in print_stack
for frame_info in list(FrameInfo.stack_data(frame, options))[-2:]:
/usr/lib/python3.11/site-packages/typeguard/__init__.py:897: in __next__
return self.send(None)
/usr/lib/python3.11/site-packages/typeguard/__init__.py:915: in send
value = self.__wrapped.send(obj)
stack_data/core.py:565: in stack_data
yield from collapse_repeated(
stack_data/utils.py:84: in collapse_repeated
yield from map(mapper, original_group)
stack_data/core.py:555: in mapper
return cls(f, options)
/usr/lib/python3.11/site-packages/typeguard/__init__.py:1033: in wrapper
retval = func(*args, **kwargs)
stack_data/core.py:520: in __init__
self.executing = Source.executing(frame_or_tb)
/usr/lib/python3.11/site-packages/executing/executing.py:354: in executing
opname(index - 2) == "PRECALL_FUNCTION"
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
i = 44
def opname(i):
return bc_list[i // 2].opname
E IndexError: list
index out of range
/usr/lib/python3.11/site-packages/executing/executing.py:346: IndexError
_________________________________ test_example
_________________________________
n = 0
def foo(n=5):
if n > 0:
return foo(n - 1)
x = 1
lst = (
[
x,
]
+ []
+ []
+ []
+ []
+ []
)
try:
return int(str(lst))
E ValueError: invalid
literal for int() with base 10: '[1]'
tests/samples/formatter_example.py:21: ValueError
During handling of the above exception, another exception occurred:
n = 0
def foo(n=5):
if n > 0:
return foo(n - 1)
x = 1
lst = (
[
x,
]
+ []
+ []
+ []
+ []
+ []
)
try:
return int(str(lst))
except:
try:
return 1 / 0
E ZeroDivisionError:
division by zero
tests/samples/formatter_example.py:24: ZeroDivisionError
The above exception was the direct cause of the following exception:
capsys = <_pytest.capture.CaptureFixture object at 0x7f8a618fc490>
def test_example(capsys):
from .samples.formatter_example import bar, print_stack1,
format_stack1, format_frame, f_string
@contextmanager
def check_example(name):
yield
stderr = capsys.readouterr().err
compare_to_file(stderr, name)
with check_example("variables"):
try:
bar()
tests/test_formatter.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def bar():
exec("foo()")
tests/samples/formatter_example.py:30:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
???
<string>:1:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
n = 5
def foo(n=5):
if n > 0:
return foo(n - 1)
tests/samples/formatter_example.py:8:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
n = 4
def foo(n=5):
if n > 0:
return foo(n - 1)
tests/samples/formatter_example.py:8:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
n = 3
def foo(n=5):
if n > 0:
return foo(n - 1)
tests/samples/formatter_example.py:8:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
n = 2
def foo(n=5):
if n > 0:
return foo(n - 1)
tests/samples/formatter_example.py:8:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
n = 1
def foo(n=5):
if n > 0:
return foo(n - 1)
tests/samples/formatter_example.py:8:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
n = 0
def foo(n=5):
if n > 0:
return foo(n - 1)
x = 1
lst = (
[
x,
]
+ []
+ []
+ []
+ []
+ []
)
try:
return int(str(lst))
except:
try:
return 1 / 0
except Exception as e:
raise TypeError from e
E TypeError
tests/samples/formatter_example.py:26: TypeError
During handling of the above exception, another exception occurred:
capsys = <_pytest.capture.CaptureFixture object at 0x7f8a618fc490>
def test_example(capsys):
from .samples.formatter_example import bar, print_stack1,
format_stack1, format_frame, f_string
@contextmanager
def check_example(name):
yield
stderr = capsys.readouterr().err
compare_to_file(stderr, name)
with check_example("variables"):
try:
bar()
except Exception:
MyFormatter(show_variables=True).print_exception()
tests/test_formatter.py:42:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
stack_data/formatting.py:72: in print_exception
self.print_lines(self.format_exception(e), file=file)
stack_data/formatting.py:83: in print_lines
for line in lines:
/usr/lib/python3.11/site-packages/typeguard/__init__.py:897: in __next__
return self.send(None)
/usr/lib/python3.11/site-packages/typeguard/__init__.py:915: in send
value = self.__wrapped.send(obj)
stack_data/formatting.py:100: in format_exception
yield from self.format_stack(e.__traceback__)
/usr/lib/python3.11/site-packages/typeguard/__init__.py:897: in __next__
return self.send(None)
/usr/lib/python3.11/site-packages/typeguard/__init__.py:915: in send
value = self.__wrapped.send(obj)
stack_data/formatting.py:107: in format_stack
yield from self.format_stack_data(
/usr/lib/python3.11/site-packages/typeguard/__init__.py:897: in __next__
return self.send(None)
/usr/lib/python3.11/site-packages/typeguard/__init__.py:915: in send
value = self.__wrapped.send(obj)
stack_data/formatting.py:118: in format_stack_data
for item in stack:
/usr/lib/python3.11/site-packages/typeguard/__init__.py:897: in __next__
return self.send(None)
/usr/lib/python3.11/site-packages/typeguard/__init__.py:915: in send
value = self.__wrapped.send(obj)
stack_data/core.py:565: in stack_data
yield from collapse_repeated(
stack_data/utils.py:84: in collapse_repeated
yield from map(mapper, original_group)
stack_data/core.py:555: in mapper
return cls(f, options)
/usr/lib/python3.11/site-packages/typeguard/__init__.py:1033: in wrapper
retval = func(*args, **kwargs)
stack_data/core.py:520: in __init__
self.executing = Source.executing(frame_or_tb)
/usr/lib/python3.11/site-packages/executing/executing.py:335: in executing
node = find_node(lasti)
/usr/lib/python3.11/site-packages/executing/executing.py:321: in find_node
return only(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
it = <generator object
Source.executing.<locals>.find_node.<locals>.<genexpr>
at 0x7f8a5ef609a0>
def only(it):
if hasattr(it, '__len__'):
if len(it) != 1:
raise NotOneValueFound('Expected one value, found %s' %
len(it))
# noinspection PyTypeChecker
return list(it)[0]
lst = tuple(islice(it, 2))
if len(lst) == 0:
raise NotOneValueFound('Expected one value, found
0')
E executing.executing.NotOneValueFound: Expected one value, found
0
/usr/lib/python3.11/site-packages/executing/executing.py:164: NotOneValueFound
----------------------------- Captured stderr call
-----------------------------
Traceback (most recent call last):
File "formatter_example.py", line 21, in foo
9 | x = 1
10 | lst = (
11 | [
12 | x,
(...)
18 | + []
19 | )
20 | try:
--> 21 | return int(str(lst))
^^^^^^^^^^^^^
22 | except:
[
x,
] = [1]
[
x,
]
+ [] = [1]
[
x,
]
+ []
+ [] = [1]
[
x,
]
+ []
+ []
+ [] = [1]
[
x,
]
+ []
+ []
+ []
+ [] = [1]
[
x,
]
+ []
+ []
+ []
+ []
+ [] = [1]
lst = [1]
n = 0
n - 1 = -1
n > 0 = False
str(lst) = '[1]'
x = 1
ValueError: invalid literal for int() with base 10: '[1]'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "formatter_example.py", line 24, in foo
21 | return int(str(lst))
22 | except:
23 | try:
--> 24 | return 1 / 0
^^^^^
25 | except Exception as e:
[
x,
] = [1]
[
x,
]
+ [] = [1]
[
x,
]
+ []
+ [] = [1]
[
x,
]
+ []
+ []
+ [] = [1]
[
x,
]
+ []
+ []
+ []
+ [] = [1]
[
x,
]
+ []
+ []
+ []
+ []
+ [] = [1]
lst = [1]
n = 0
n - 1 = -1
n > 0 = False
str(lst) = '[1]'
x = 1
ZeroDivisionError: division by zero
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "formatter_example.py", line 30, in bar
29 | def bar():
--> 30 | exec("foo()")
^^^^^^^^^^^^^
=============================== warnings summary
===============================
../../../../usr/lib64/python3.11/site-packages/pyximport/pyximport.py:51
/usr/lib64/python3.11/site-packages/pyximport/pyximport.py:51:
DeprecationWarning: the imp module is deprecated in favour of importlib and
slated for removal in Python 3.12; see the module's documentation for
alternative uses
import imp
-- Docs:
https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info
============================
FAILED tests/test_core.py::test_example -
executing.executing.NotOneValueFoun...
FAILED tests/test_core.py::test_pygments_example - IndexError: list index
out...
FAILED tests/test_formatter.py::test_example -
executing.executing.NotOneValu...
=================== 3 failed, 13 passed, 1 warning in 3.03s
====================
ERROR: InvocationError for command /usr/bin/pytest (exited with code 1)
___________________________________ summary
____________________________________
ERROR: py311: commands failed
https://docs.python.org/3.11/whatsnew/3.11.html
For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.11/fedora...
For all our attempts to build python-stack-data with Python 3.11, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/pytho...
Testing and mass rebuild of packages is happening in copr. You can follow these
instructions to test locally in mock if your package builds with Python 3.11:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/
Let us know here if you have any questions.
Python 3.11 is planned to be included in Fedora 37. To make that update
smoother, we're building Fedora packages with all pre-releases of Python 3.11.
A build failure prevents us from testing all dependent packages (transitive
[Build]Requires), so if this package is required a lot, it's important for us
to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you
don't want to work on this now, let us know so we can try to work around it on
our side.
Referenced Bugs:
https://bugzilla.redhat.com/show_bug.cgi?id=2016048
[Bug 2016048] Python 3.11
--
You are receiving this mail because:
You are on the CC list for the bug.
https://bugzilla.redhat.com/show_bug.cgi?id=2069709