Skip to content

fix(compat): fix deprecated stdlib and third-party API usages for Python 3.14#81

Merged
alexsander-souza merged 2 commits intocanonical:resolute_supportfrom
alexsander-souza:pr-06/deprecation-fixes
Apr 2, 2026
Merged

fix(compat): fix deprecated stdlib and third-party API usages for Python 3.14#81
alexsander-souza merged 2 commits intocanonical:resolute_supportfrom
alexsander-souza:pr-06/deprecation-fixes

Conversation

@alexsander-souza
Copy link
Copy Markdown
Contributor

Address runtime warnings and errors surfaced by the Python 3.14 and dependency upgrades.

  • asyncio.iscoroutinefunction removed in 3.12 -> inspect.iscoroutinefunction
  • re.split positional maxsplit -> keyword argument maxsplit=1
  • zip() calls without strict -> zip(..., strict=False)
  • maasapiserver/tls.py: sync with uvicorn 0.38 lifespan API; replace _get_upgrade()/_should_upgrade_to_ws() with _should_upgrade(); add MUST_CLOSE guard to EndOfMessage handler
  • provisioningserver/logger/_twisted.py: extend module check to accept _py_warnings for CPython 3.14
  • maas_api_helper.py: wrap HTTPResponse in contextlib.closing to fix resource leak

…hon 3.14

Address runtime warnings and errors surfaced by the Python 3.14 and
dependency upgrades, separate from the Twisted deprecations (PR-05)
and test-framework fixes (PR-10).

- asyncio.iscoroutinefunction removed in 3.12 -> inspect.iscoroutinefunction
- re.split positional maxsplit -> keyword argument maxsplit=1
- zip() calls without strict -> zip(..., strict=False)
- maasapiserver/tls.py: sync with uvicorn 0.38 lifespan API; replace
  _get_upgrade()/_should_upgrade_to_ws() with _should_upgrade(); add
  MUST_CLOSE guard to EndOfMessage handler
- provisioningserver/logger/_twisted.py: extend __module__ check to
  accept _py_warnings for CPython 3.14
- maas_api_helper.py: wrap HTTPResponse in contextlib.closing to fix
  resource leak
@alexsander-souza alexsander-souza marked this pull request as ready for review March 31, 2026 22:10
Copy link
Copy Markdown
Contributor

@r00ta r00ta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question inline. The rest looks good

Comment thread src/provisioningserver/logger/_twisted.py Outdated
@alexsander-souza alexsander-souza merged commit f6ddaad into canonical:resolute_support Apr 2, 2026
1 of 2 checks passed
@alexsander-souza alexsander-souza deleted the pr-06/deprecation-fixes branch April 2, 2026 12:45
alexsander-souza added a commit that referenced this pull request Apr 8, 2026
…hon 3.14 (#81)

Address runtime warnings and errors surfaced by the Python 3.14 and dependency upgrades.

- asyncio.iscoroutinefunction removed in 3.12 -> inspect.iscoroutinefunction
- re.split positional maxsplit -> keyword argument maxsplit=1
- zip() calls without strict -> zip(..., strict=False)
- maasapiserver/tls.py: sync with uvicorn 0.38 lifespan API; replace _get_upgrade()/_should_upgrade_to_ws() with _should_upgrade(); add MUST_CLOSE guard to EndOfMessage handler
- provisioningserver/logger/_twisted.py: extend __module__ check to accept _py_warnings for CPython 3.14
- maas_api_helper.py: wrap HTTPResponse in contextlib.closing to fix resource leak
alexsander-souza added a commit that referenced this pull request Apr 8, 2026
…hon 3.14 (#81)

Address runtime warnings and errors surfaced by the Python 3.14 and dependency upgrades.

- asyncio.iscoroutinefunction removed in 3.12 -> inspect.iscoroutinefunction
- re.split positional maxsplit -> keyword argument maxsplit=1
- zip() calls without strict -> zip(..., strict=False)
- maasapiserver/tls.py: sync with uvicorn 0.38 lifespan API; replace _get_upgrade()/_should_upgrade_to_ws() with _should_upgrade(); add MUST_CLOSE guard to EndOfMessage handler
- provisioningserver/logger/_twisted.py: extend __module__ check to accept _py_warnings for CPython 3.14
- maas_api_helper.py: wrap HTTPResponse in contextlib.closing to fix resource leak
alexsander-souza added a commit that referenced this pull request Apr 9, 2026
…hon 3.14 (#81)

Address runtime warnings and errors surfaced by the Python 3.14 and dependency upgrades.

- asyncio.iscoroutinefunction removed in 3.12 -> inspect.iscoroutinefunction
- re.split positional maxsplit -> keyword argument maxsplit=1
- zip() calls without strict -> zip(..., strict=False)
- maasapiserver/tls.py: sync with uvicorn 0.38 lifespan API; replace _get_upgrade()/_should_upgrade_to_ws() with _should_upgrade(); add MUST_CLOSE guard to EndOfMessage handler
- provisioningserver/logger/_twisted.py: extend __module__ check to accept _py_warnings for CPython 3.14
- maas_api_helper.py: wrap HTTPResponse in contextlib.closing to fix resource leak
alexsander-souza added a commit that referenced this pull request Apr 17, 2026
…hon 3.14 (#81)

Address runtime warnings and errors surfaced by the Python 3.14 and dependency upgrades.

- asyncio.iscoroutinefunction removed in 3.12 -> inspect.iscoroutinefunction
- re.split positional maxsplit -> keyword argument maxsplit=1
- zip() calls without strict -> zip(..., strict=False)
- maasapiserver/tls.py: sync with uvicorn 0.38 lifespan API; replace _get_upgrade()/_should_upgrade_to_ws() with _should_upgrade(); add MUST_CLOSE guard to EndOfMessage handler
- provisioningserver/logger/_twisted.py: extend __module__ check to accept _py_warnings for CPython 3.14
- maas_api_helper.py: wrap HTTPResponse in contextlib.closing to fix resource leak
alexsander-souza added a commit that referenced this pull request Apr 17, 2026
…hon 3.14 (#81)

Address runtime warnings and errors surfaced by the Python 3.14 and dependency upgrades.

- asyncio.iscoroutinefunction removed in 3.12 -> inspect.iscoroutinefunction
- re.split positional maxsplit -> keyword argument maxsplit=1
- zip() calls without strict -> zip(..., strict=False)
- maasapiserver/tls.py: sync with uvicorn 0.38 lifespan API; replace _get_upgrade()/_should_upgrade_to_ws() with _should_upgrade(); add MUST_CLOSE guard to EndOfMessage handler
- provisioningserver/logger/_twisted.py: extend __module__ check to accept _py_warnings for CPython 3.14
- maas_api_helper.py: wrap HTTPResponse in contextlib.closing to fix resource leak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants