Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI Tests Failure with Release of Python 3.12.0-alpha.7 #1165

Closed
rmartin16 opened this issue Apr 6, 2023 · 4 comments
Closed

CI Tests Failure with Release of Python 3.12.0-alpha.7 #1165

rmartin16 opened this issue Apr 6, 2023 · 4 comments
Labels
bug A crash or error in behavior.

Comments

@rmartin16
Copy link
Member

Describe the bug

CI test failure showed up today; wasn't happening on Python 3.12.0-alpha.6

==============================================================================
ERROR: tests/integrations/download/test_Download__file.py::test_content_connection_error
------------------------------------------------------------------------------
Downloading something.zip...

Traceback (most recent call last):
  File "D:\a\briefcase\briefcase\tests\integrations\download\test_Download__file.py", line 363, in test_content_connection_error
    mock_tools.download.file(
  File "D:\a\briefcase\briefcase\.tox\py\Lib\site-packages\briefcase\integrations\download.py", line 85, in file
    self._fetch_and_write_content(response, filename)
  File "D:\a\briefcase\briefcase\.tox\py\Lib\site-packages\briefcase\integrations\download.py", line 116, in _fetch_and_write_content
    temp_file.write(response.content)
  File "C:\hostedtoolcache\windows\Python\3.12.0-alpha.7\x64\Lib\tempfile.py", line 483, in func_wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
TypeError: a bytes-like object is required, not 'MagicMock'

Steps to reproduce

CI

Expected behavior

CI passes.

Screenshots

No response

Environment

  • Operating System: Windows, macOS, Ubuntu
  • Python version: 3.12.0-alpha.7
  • Software versions:
    • Briefcase: 0.3.14.dev78+g3f8b8979

Logs

No response

Additional context

No response

@rmartin16 rmartin16 added the bug A crash or error in behavior. label Apr 6, 2023
@rmartin16
Copy link
Member Author

well...I don't know what's causing this....maybe a bug in this alpha

fwiw, using a debug version of Python 3.12.0a7, I get a hard crash:

❯ pytest tests/integrations/download/ -k test_content_connection_error
Fatal Python error: Aborted

Current thread 0x00007f94a529fb80 (most recent call first):
  File "/home/russell/.pyenv/versions/3.12.0a7-debug/lib/python3.12/unittest/mock.py", line 647 in __getattr__
  File "/home/russell/github/beeware/briefcase/src/briefcase/integrations/download.py", line 116 in _fetch_and_write_content
  File "/home/russell/github/beeware/briefcase/src/briefcase/integrations/download.py", line 85 in file
  File "/home/russell/github/beeware/briefcase/tests/integrations/download/test_Download__file.py", line 361 in test_content_connection_error
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/_pytest/python.py", line 195 in pytest_pyfunc_call
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/_pytest/python.py", line 1789 in runtest
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/_pytest/runner.py", line 167 in pytest_runtest_call
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/_pytest/runner.py", line 260 in <lambda>
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/_pytest/runner.py", line 339 in from_call
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/_pytest/runner.py", line 259 in call_runtest_hook
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/_pytest/runner.py", line 220 in call_and_report
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/_pytest/runner.py", line 131 in runtestprotocol
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/_pytest/runner.py", line 112 in pytest_runtest_protocol
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/_pytest/main.py", line 349 in pytest_runtestloop
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/_pytest/main.py", line 324 in _main
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/_pytest/main.py", line 270 in wrap_session
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/_pytest/main.py", line 317 in pytest_cmdline_main
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/pluggy/_callers.py", line 39 in _multicall
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/pluggy/_manager.py", line 80 in _hookexec
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/pluggy/_hooks.py", line 265 in __call__
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/_pytest/config/__init__.py", line 167 in main
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/lib/python3.12/site-packages/_pytest/config/__init__.py", line 190 in console_main
  File "/home/russell/github/beeware/briefcase/venv-3.12.0a7-briefcase/bin/pytest", line 8 in <module>

Extension modules: markupsafe._speedups, psutil._psutil_linux, psutil._psutil_posix (total: 3)
Aborted (core dumped)

@freakboy3742
Copy link
Member

Looks like a regression in unitest.mock.PropertyMock.

@freakboy3742
Copy link
Member

freakboy3742 commented Apr 8, 2023

This has been fixed in CPython main in python/cpython#103332; a regression test has been submitted in python/cpython#103358. Unfortunately, we won't see the benefit of this until a new release is cut, which won't be until early May with the release of 3.12.0b1.

@rmartin16
Copy link
Member Author

Python 3.12.0b1 included the fix for this issue. Further work for Python 3.12 support is being tracked in #1290.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A crash or error in behavior.
Projects
None yet
Development

No branches or pull requests

2 participants