Menu

evalFile is evil!

Help
Neosettler
2013-05-31
2015-11-09
  • Neosettler

    Neosettler - 2013-05-31

    Greetings,

    After a long and painful beating, I finally discovered the source of my misery. For some reason, evalFile does crash while creating a pyc file in debug mode and I've been overboard finding the glitch. I believe the reason it as been undetected is because the sample files does not explicitly create pyc files.

    evalFile(":example.py") /// works!
    evalFile("example.py") /// crash!

    I'm guessing the ':' is telling not to create a pyc file but I don't know for sure.

    Usually, scripts are not based at the root folder of the API so I tried ':C:/scripts/example.py'... Windows doesn't like that.

    Can anyone confirm the madness or I'm taking crazy pills?

     
  • Florian Link

    Florian Link - 2013-05-31

    Crazypills

     
  • Tommaso Vinci

    Tommaso Vinci - 2013-05-31

    I have the same problem and I ended up calling evalscript :

    ifdef Q_OS_WIN32

            //FIXME test windows
            QFile t(QString::fromStdString(argv[i]));
            t.open(QIODevice::ReadOnly| QIODevice::Text);
            QTextStream out(&t);
            PythonQt::self()->getMainModule().evalScript(out.readAll());
            t.close();
    

    else

            PythonQt::self()->getMainModule().evalFile(QString(argv[i]));
    

    endif

     
  • Neosettler

    Neosettler - 2013-05-31

    Florian would put me in a madhouse straight up! :)

    Yes Tom, thanks for the tip. That is exactly what I did a week ago but I went completely crazy trying to fix this as in my mind, it wasn't possible that this could be happening without me doing something wrong. I'm rather confident now that this issue is beyond my reach.

     
    • mr antback

      mr antback - 2015-11-09

      Hi, I have spent three days investigating this issue until I have checked that evailScript works but evailFile doesn't. At least, I'm not alone :)

      Thanks

       

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.