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

Curio cannot be imported in python 3.12 #367

Open
hyperrealist opened this issue Feb 22, 2024 · 4 comments
Open

Curio cannot be imported in python 3.12 #367

hyperrealist opened this issue Feb 22, 2024 · 4 comments

Comments

@hyperrealist
Copy link

Importing curio in python 3.12 results in the following error:

In [1]: import curio
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[1], line 1
----> 1 import curio

File ~/.local/miniconda3/envs/test-p312/lib/python3.12/site-packages/curio/__init__.py:6
      3 __version__ = '1.6'
      5 from .errors import *
----> 6 from .queue import *
      7 from .task import *
      8 from .time import *

File ~/.local/miniconda3/envs/test-p312/lib/python3.12/site-packages/curio/queue.py:20
     18 from .errors import CurioError, CancelledError
     19 from .meta import awaitable, asyncioable
---> 20 from . import workers
     22 __all__ = ['Queue', 'PriorityQueue', 'LifoQueue', 'UniversalQueue']
     24 class QueueBase:

File ~/.local/miniconda3/envs/test-p312/lib/python3.12/site-packages/curio/workers.py:23
     21 from .traps import _future_wait, _get_kernel
     22 from . import sync
---> 23 from .channel import Connection
     25 # Code to embed a traceback in a remote exception.  This is borrowed
     26 # straight from multiprocessing.pool.  Copied here to avoid possible
     27 # confusion when reading the traceback message (it will identify itself
     28 # as originating from curio as opposed to multiprocessing.pool).
     30 class RemoteTraceback(Exception):

File ~/.local/miniconda3/envs/test-p312/lib/python3.12/site-packages/curio/channel.py:31
     28 # Authentication parameters (copied from multiprocessing)
     30 AUTH_MESSAGE_LENGTH = mpc.MESSAGE_LENGTH    # 20
---> 31 CHALLENGE = mpc.CHALLENGE                   # b'#CHALLENGE#'
     32 WELCOME = mpc.WELCOME                       # b'#WELCOME#'
     33 FAILURE = mpc.FAILURE                       # b'#FAILURE#'

AttributeError: module 'multiprocessing.connection' has no attribute 'CHALLENGE'
@klen
Copy link

klen commented Feb 22, 2024

This has been fixed in a5590bb, but packages wasn't updated 🤷‍♂️

The Curio project is no longer making package releases. I'm more than happy to accept bug reports and may continue to work on it from time to time as the mood strikes.
If you want the absolute latest version, you should vendor the source code from here. Curio has no dependencies other than the Python standard library. --Dave

@dabeaz
Copy link
Owner

dabeaz commented Apr 2, 2024

I'm not seeing a failure on Python 3.12 so it seems to be fixed at the moment.

@klen
Copy link

klen commented Apr 8, 2024

@dabeaz Installed the latest python 3.12.2 (Apr 8 2024) and the latest curio from pypi:

Python 3.12.2 (main, Apr  8 2024, 12:08:45) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import curio
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/horneds/projects/asgi-tools/.venv/lib/python3.12/site-packages/curio/__init__.py", line 6, in <module>
    from .queue import *
  File "/Users/horneds/projects/asgi-tools/.venv/lib/python3.12/site-packages/curio/queue.py", line 20, in <module>
    from . import workers
  File "/Users/horneds/projects/asgi-tools/.venv/lib/python3.12/site-packages/curio/workers.py", line 23, in <module>
    from .channel import Connection
  File "/Users/horneds/projects/asgi-tools/.venv/lib/python3.12/site-packages/curio/channel.py", line 31, in <module>
    CHALLENGE = mpc.CHALLENGE                   # b'#CHALLENGE#'
                ^^^^^^^^^^^^^
AttributeError: module 'multiprocessing.connection' has no attribute 'CHALLENGE'. Did you mean: '_CHALLENGE'?
>>>

The issue is fixed on Github, but the pypi package is not updated 🤷‍♂️

@klen
Copy link

klen commented Jul 31, 2024

I've created a PYPI package: https://pypi.org/project/curio-compat

which one is a fork of the repository but contains the latest commits. So now we are able to install curio from pypi for python 3.12.

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

No branches or pull requests

3 participants