Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Per-Interpreter GIL] Unable to import module _datetime into subinterpreters in 3.12 #111378

Closed
jackyk02 opened this issue Oct 27, 2023 · 3 comments
Labels
topic-subinterpreters type-bug An unexpected behavior, bug, or error

Comments

@jackyk02
Copy link

jackyk02 commented Oct 27, 2023

Bug report

Bug description:

Code Example:

import _xxsubinterpreters
from _datetime import *
id = _xxsubinterpreters.create()
number = 1000
input_string = f'''import _datetime
print(dt.datetime_CAPI)
'''
_xxsubinterpreters.run_string(id, input_string)

Output from python3.12 example.py:

Traceback (most recent call last):
  File "/mnt/c/Users/jacky/Desktop/simple_multi/src-gen/workers2_compiledwith12/test_custom.py", line 13, in <module>
    _xxsubinterpreters.run_string(id, input_string)
_xxsubinterpreters.RunFailedError: <class 'ImportError'>: module _datetime does not support loading in subinterpreters

CPython versions tested on:

3.12

Operating systems tested on:

Linux

@ericsnowcurrently @ericvsmith Any help would be much appreciated :)

@jackyk02 jackyk02 added the type-bug An unexpected behavior, bug, or error label Oct 27, 2023
@jackyk02 jackyk02 changed the title Unable to import module _datetime into subinterpreters in 3.12 [Per-Interpreter GIL] Unable to import module _datetime into subinterpreters in 3.12 Oct 27, 2023
@gaogaotiantian
Copy link
Member

I believe _datetime is not isolated yet so it's not available in subinterpreters. This might be a dup of #110415 and the previous discusson #71587

@ericsnowcurrently
Copy link
Member

I believe _datetime is not isolated yet so it's not available in subinterpreters. This might be a dup of #110415 and the previous discusson #71587

Correct.

@jackyk02, if you agree this is a duplicate then please close this issue. If it is a different problem then please elaborate. Thanks!

@erlend-aasland erlend-aasland added the pending The issue will be closed if no feedback is provided label Oct 30, 2023
@erlend-aasland
Copy link
Contributor

Closing as a duplicate.

@erlend-aasland erlend-aasland closed this as not planned Won't fix, can't repro, duplicate, stale Oct 30, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in Subinterpreters Oct 30, 2023
@erlend-aasland erlend-aasland removed the pending The issue will be closed if no feedback is provided label Oct 30, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
topic-subinterpreters type-bug An unexpected behavior, bug, or error
Projects
Status: Done
Development

No branches or pull requests

5 participants