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

SafeChildWatcher is deprecated in Python 3.14 #497

Open
rmartin16 opened this issue Aug 6, 2024 · 2 comments
Open

SafeChildWatcher is deprecated in Python 3.14 #497

rmartin16 opened this issue Aug 6, 2024 · 2 comments
Labels
bug A crash or error in behavior.

Comments

@rmartin16
Copy link
Member

rmartin16 commented Aug 6, 2024

Describe the bug

It appears the whole concept of "child watchers" was removed from Python.

    from rubicon.objc.eventloop import CocoaLifecycle, EventLoopPolicy
  File "/Users/user/.pyenv/versions/briefcase-3.14-dev/lib/python3.14/site-packages/rubicon/objc/eventloop.py", line 5, in <module>
    from asyncio import (
    ...<6 lines>...
    )
ImportError: cannot import name 'SafeChildWatcher' from 'asyncio' (/Users/user/.pyenv/versions/3.14-dev/lib/python3.14/asyncio/__init__.py)

Steps to reproduce

Attempt to start the event loop using Python 3.14.

Expected behavior

Event loop can start on Python 3.14.

Screenshots

No response

Environment

  • Operating System: Sonoma
  • Python version: 3.14.0a0
  • Software versions:
    • Rubicon-ObjC: 0.4.9

Logs

No response

Additional context

This issue may more broadly capture the need to support Python 3.14 but I am not sure what else would be needed beyond resolving this child watcher issue.

RE: beeware/gbulb#171

@rmartin16 rmartin16 added the bug A crash or error in behavior. label Aug 6, 2024
@freakboy3742
Copy link
Member

I'm surprised this hasn't been surfaced as a deprecation warning in 3.12 and 3.13 testing... but it's definitely something that needs to be addressed.

@rmartin16
Copy link
Member Author

rmartin16 commented Aug 6, 2024

It may just be that nothing is exercising this code in our use-cases.

EventLoopPolicy is implementing asyncio.events.AbstractEventLoopPolicy which used to require get_child_watcher() and is the only caller (AFAICT) of _init_watcher()...but neither the testing for Rubicon-ObjC nor Toga actually uses this.

At this point, AbstractEventLoopPolicy only requires get_event_loop(), set_event_loop(), and new_event_loop(); so, maybe it's reasonable to just only define methods for get_child_watcher() and set_child_watcher() on versions before 3.14.

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

Successfully merging a pull request may close this issue.

2 participants