Skip to content

Different behaviour between 41.0.0, 41.0.1 and 40.0.2 - PyO3 modules may only be initialized once per interpreter process #9016

@pipiche38

Description

@pipiche38

Different behaviour between 41.0.0, 41.0.1 and 40.0.2.

We are using cryptography via zigpy libraries. All of that is embedded into a C++ application which used Embedded Python Libraries in order to run some python codes.

We have detected a behaviour change since 40.0.2, which made our code not working anymore ( see the here after stack trace)

any ideas would be more than welcome

with cryptography 41.0.0 and cryptography 41.0.1

Jun 02 16:51:04 rasp domoticz[23722]: 2023-06-02 16:51:04.077 Error: Zigpy-Elelabs: Call to function 'onStart' failed, exception details:
Jun 02 16:51:04 rasp domoticz[23722]: 2023-06-02 16:51:04.082 Error: Zigpy-Elelabs: Traceback (most recent call last):
Jun 02 16:51:04 rasp domoticz[23722]: 2023-06-02 16:51:04.083 Error: Zigpy-Elelabs: File "/var/lib/domoticz/plugins/Domoticz-Zigbee/plugin.py", line 1537, in onStart
Jun 02 16:51:04 rasp domoticz[23722]: 2023-06-02 16:51:04.083 Error: Zigpy-Elelabs: _plugin.onStart()
Jun 02 16:51:04 rasp domoticz[23722]: 2023-06-02 16:51:04.083 Error: Zigpy-Elelabs: File "/var/lib/domoticz/plugins/Domoticz-Zigbee/plugin.py", line 602, in onStart
Jun 02 16:51:04 rasp domoticz[23722]: 2023-06-02 16:51:04.083 Error: Zigpy-Elelabs: from zigpy.config import (CONF_DEVICE, CONF_DEVICE_PATH,
Jun 02 16:51:04 rasp domoticz[23722]: 2023-06-02 16:51:04.083 Error: Zigpy-Elelabs: File "/usr/local/lib/python3.10/site-packages/zigpy/config/init.py", line 32, in
Jun 02 16:51:04 rasp domoticz[23722]: 2023-06-02 16:51:04.083 Error: Zigpy-Elelabs: from zigpy.config.validators import (
Jun 02 16:51:04 rasp domoticz[23722]: 2023-06-02 16:51:04.083 Error: Zigpy-Elelabs: File "/usr/local/lib/python3.10/site-packages/zigpy/config/validators.py", line 9, in
Jun 02 16:51:04 rasp domoticz[23722]: 2023-06-02 16:51:04.083 Error: Zigpy-Elelabs: import zigpy.zdo.types as zdo_t
Jun 02 16:51:04 rasp domoticz[23722]: 2023-06-02 16:51:04.083 Error: Zigpy-Elelabs: File "/usr/local/lib/python3.10/site-packages/zigpy/zdo/init.py", line 10, in
Jun 02 16:51:04 rasp domoticz[23722]: 2023-06-02 16:51:04.083 Error: Zigpy-Elelabs: import zigpy.util
Jun 02 16:51:04 rasp domoticz[23722]: 2023-06-02 16:51:04.083 Error: Zigpy-Elelabs: File "/usr/local/lib/python3.10/site-packages/zigpy/util.py", line 14, in
Jun 02 16:51:04 rasp domoticz[23722]: 2023-06-02 16:51:04.083 Error: Zigpy-Elelabs: from cryptography.hazmat.primitives.ciphers import Cipher
Jun 02 16:51:04 rasp domoticz[23722]: 2023-06-02 16:51:04.083 Error: Zigpy-Elelabs: File "/usr/local/lib/python3.10/site-packages/cryptography/hazmat/primitives/ciphers/init.py", line 11, in
Jun 02 16:51:04 rasp domoticz[23722]: 2023-06-02 16:51:04.083 Error: Zigpy-Elelabs: from cryptography.hazmat.primitives.ciphers.base import (
Jun 02 16:51:04 rasp domoticz[23722]: 2023-06-02 16:51:04.083 Error: Zigpy-Elelabs: File "/usr/local/lib/python3.10/site-packages/cryptography/hazmat/primitives/ciphers/base.py", line 10, in
Jun 02 16:51:04 rasp domoticz[23722]: 2023-06-02 16:51:04.083 Error: Zigpy-Elelabs: from cryptography.exceptions import (
Jun 02 16:51:04 rasp domoticz[23722]: 2023-06-02 16:51:04.083 Error: Zigpy-Elelabs: File "/usr/local/lib/python3.10/site-packages/cryptography/exceptions.py", line 9, in
Jun 02 16:51:04 rasp domoticz[23722]: 2023-06-02 16:51:04.083 Error: Zigpy-Elelabs: from cryptography.hazmat.bindings._rust import exceptions as rust_exceptions
Jun 02 16:51:04 rasp domoticz[23722]: 2023-06-02 16:51:04.083 Error: Zigpy-Elelabs: ImportError: PyO3 modules may only be initialized once per interpreter process

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions