Skip to content

Error on multiprocessing.log_to_stderr(level=None) #115461

Closed as not planned
Closed as not planned
@arthursw

Description

@arthursw

Bug report

Bug description:

The function multiprocessing.log_to_stderr() throws an error:

Python 3.10.13 (main, Sep 11 2023, 08:16:02) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import multiprocessing
>>> logger = multiprocessing.log_to_stderr()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/amasson/micromamba/envs/nf_cloud/lib/python3.10/multiprocessing/context.py", line 162, in log_to_stderr
    return log_to_stderr(level)
  File "/Users/amasson/micromamba/envs/nf_cloud/lib/python3.10/multiprocessing/util.py", line 94, in log_to_stderr
    logger = get_logger()
  File "/Users/amasson/micromamba/envs/nf_cloud/lib/python3.10/multiprocessing/util.py", line 67, in get_logger
    logging._acquireLock()
AttributeError: module 'logging' has no attribute '_acquireLock'
>>> 

Same thing with Python 12.0:

Python 3.12.0 (v3.12.0:0fb18b02c8, Oct  2 2023, 09:45:56) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import multiprocessing
>>> logger = multiprocessing.log_to_stderr()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/multiprocessing/context.py", line 162, in log_to_stderr
    return log_to_stderr(level)
           ^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/multiprocessing/util.py", line 94, in log_to_stderr
    logger = get_logger()
             ^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/multiprocessing/util.py", line 67, in get_logger
    logging._acquireLock()
    ^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'logging' has no attribute '_acquireLock'

CPython versions tested on:

3.10, 3.12

Operating systems tested on:

macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions