Menu

python not getting initialized bug in 2.0

Help
Anonymous
2010-05-15
2013-04-06
  • Anonymous

    Anonymous - 2010-05-15

    With 2.0 version now receiving:
    "Fatal Python error: PyThreadState_Get: no current thread"
    on e.g. PyGettingStarted example

    Appears that Py_Initialize is not getting invoked. Commenting out these lines fixes the problem:

      //if (flags & PythonAlreadyInitialized == 0) {
        Py_SetProgramName("PythonQt");
        if (flags & IgnoreSiteModule) {
          // this prevents the automatic importing of Python site files
          Py_NoSiteFlag = 1;
        }
        qDebug() << "Py_Initialize() start";
        Py_Initialize();
        qDebug() << "Py_Initialize() done";
    //}

     
  • Florian Link

    Florian Link - 2010-05-15

    You are right, the correct line is

    if ((flags & PythonAlreadyInitialized) == 0) {

    }

    I added this as a last minute feature and it broke PythonQt… I fixed it and uploaded PythonQt 2.0.1.
    Lesson learned: Run your tests before releasing, even if it is late in the night…

     
  • Anonymous

    Anonymous - 2010-05-16

    At first I assumed this was a build problem on my end (e.g. pointing to incorrect dlls). I glanced over that code more than once before seeing the issue. So clearly the lesson learned is that C++ bitwise operators need to be given higher precedence ;-)

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.