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

examples/swmr_inotify_example.py: asyncore module is deprecated and removed in Python 3.12 #2292

Open
drew-parsons opened this issue Aug 2, 2023 · 2 comments

Comments

@drew-parsons
Copy link
Contributor

h5py provides the example swmr_inotify_example.py

It uses asyncore which has been deprecated since python3.6.
Running the example warns that it will soon be removed:

$ python3 swmr_inotify_example.py 
/projects/h5py/examples/swmr_inotify_example.py:20: DeprecationWarning: The asyncore module is deprecated and will be removed in Python 3.12. The recommended replacement is asyncio
  import asyncore

Evidently asyncio should be used instead.

See also https://peps.python.org/pep-0594/#deprecated-modules

$ python3 -c 'import h5py; print(h5py.version.info)'
Summary of the h5py configuration
---------------------------------

h5py    3.9.0
HDF5    1.10.8
Python  3.11.4 (main, Jun  7 2023, 10:13:09) [GCC 12.2.0]
sys.platform    linux
sys.maxsize     9223372036854775807
numpy   1.24.2
cython (built with) 0.29.36
numpy (built against) 1.24.2
HDF5 (built against) 1.10.8
@tacaswell
Copy link
Member

The work here is to re-write that example using modern async tools.

@takluyver
Copy link
Member

This is further complicated because pyinotify itself seems to be dead. There are a few different inotify interfaces out there, but it looks like the cross-platform watchdog package might be the most actively maintained & widely used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants