[issue37016] Python embedded in C++ cannot open a file

Soumya Mohanty report at bugs.python.org
Wed May 22 17:45:30 EDT 2019


New submission from Soumya Mohanty <mohanty.s at husky.neu.edu>:

Hello,
I am trying to open a pickled file and load it in my python file.

This python file will be called from a c++ program. Please find the C++ program attached.  

Py_Initialize and Py_Finalize are being done in a separate file called pyhelper.hpp

Python code :

def test():
    print("In function test of pyemb.py file \n")    
    import pickle
    with open('filepath', 'rb') as f_in:
        C = pickle.load(f_in)

I am getting the following error and cant find any way to fix it:

Exception ignored in: <module 'threading' from 'C:\\Anaconda3\\envs\\Deep_Learning\\lib\\threading.py'>
Traceback (most recent call last):
  File "C:\Anaconda3\envs\Deep_Learning\lib\threading.py", line 1289, in _shutdown
    assert tlock.locked()
SystemError: <built-in method locked of _thread.lock object at 0x000002328D1EAAA8> returned a result with an error set

----------
files: PYTHON_PROJ.cpp
messages: 343246
nosy: mohantys
priority: normal
severity: normal
status: open
title: Python embedded in C++ cannot open a file
versions: Python 3.6
Added file: https://bugs.python.org/file48350/PYTHON_PROJ.cpp

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37016>
_______________________________________


More information about the Python-bugs-list mailing list