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

The addresses of multiprocessing.connection can also be bytes #10054

Open
lw opened this issue Apr 17, 2023 · 1 comment
Open

The addresses of multiprocessing.connection can also be bytes #10054

lw opened this issue Apr 17, 2023 · 1 comment

Comments

@lw
Copy link

lw commented Apr 17, 2023

Typeshed says that the addresses used in multiprocessing.connection are str | tuple[str, int]. However, sometimes a bytes can be returned as well:

$ python3
Python 3.9.15 (main, Nov 24 2022, 14:31:59)
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from multiprocessing.connection import Listener
>>> l = Listener("", "AF_UNIX")
>>> l.address
b'\x00listener-1553475-0'

I believe this is "new" starting in Python 3.9.

@srittau
Copy link
Collaborator

srittau commented Apr 17, 2023

I think our best bet - unfortunately - is annotating address using Any. (Cf. python/typing#566)

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

2 participants