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

Python 3.13: billiard.util.get_logger() is broken #403

Closed
musicinmybrain opened this issue Jun 15, 2024 · 5 comments · Fixed by #404
Closed

Python 3.13: billiard.util.get_logger() is broken #403

musicinmybrain opened this issue Jun 15, 2024 · 5 comments · Fixed by #404

Comments

@musicinmybrain
Copy link
Contributor

Since logging._acquireLock is no longer present in Python 3.13, billiard.util.get_logger() no longer works:

$ gh repo clone celery/billiard
$ cd billiard
$ PYTHONPATH="${PWD}" python3.12 -c 'from billiard.util import get_logger; print(get_logger())'
<Logger multiprocessing (WARNING)>
$ PYTHONPATH="${PWD}" python3.13 -c 'from billiard.util import get_logger; print(get_logger())'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
    from billiard.util import get_logger; print(get_logger())
                                                ~~~~~~~~~~^^
  File "/home/ben/src/forks/billiard/billiard/util.py", line 131, in get_logger
    logging._acquireLock()
    ^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'logging' has no attribute '_acquireLock'
@auvipy
Copy link
Member

auvipy commented Jun 15, 2024

can you please submit a PR?

@musicinmybrain
Copy link
Contributor Author

Currently in Python 3.13, the functions _prepareFork and _afterFork correspond closely to the old _acquireLock and _releaseLock. I suppose (as long as billiard is already using non-public APIs) it’s easiest to just call those on Python 3.13.

That approach could perhaps break in the future if these functions start doing something other than acquire/release a module lock, but copying their contents could also break if the internal locking semantics change in a future Python, so 🤷.

@skshetry
Copy link

Hi, is there any plans to release billiard soon? I'm currently working on adding 3.13 support, and would appreciate if this was released.

@Nusnus
Copy link
Member

Nusnus commented Sep 1, 2024

Hi, is there any plans to release billiard soon? I'm currently working on adding 3.13 support, and would appreciate if this was released.

Yes we can do that. Please do add 3.13 and add me for review. After it's done I'll release a new version.

Thank you!

@Nusnus
Copy link
Member

Nusnus commented Sep 21, 2024

Fix released in Billiard v4.2.1

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 a pull request may close this issue.

4 participants