script.remove( QRegExp("^python.*[\\s]+") );
QString cmd = script+" "+args;
- QString command = QString( "exec(open(\"%1\").read())" ).arg(cmd.trimmed());
+ QString command = QString( "exec(open(\"%1\", \"rb\").read())" ).arg(cmd.trimmed());
pyConsole->exec(command);
}
} // end for loop on pyfiles QStringList
{
onNewDoc();
- QString command = QString("exec(open(\"%1\").read())").arg(aFile);
+ QString command = QString("exec(open(\"%1\", \"rb\").read())").arg(aFile);
#ifndef DISABLE_PYCONSOLE
PyConsole_Console* pyConsole = pythonConsole();
if ( !aFile.isEmpty() )
{
- QString command = QString("exec(open(\"%1\").read())").arg(aFile);
+ QString command = QString("exec(open(\"%1\", \"rb\").read())").arg(aFile);
#ifndef DISABLE_PYCONSOLE
PyConsole_Console* pyConsole = pythonConsole();
SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
// load study from the temporary directory
- QString command = QString( "exec(open(\"%1\").read())" ).arg( theDumpScript );
+ QString command = QString( "exec(open(\"%1\" ,\"rb\").read())" ).arg( theDumpScript );
#ifndef DISABLE_PYCONSOLE
PyConsole_Console* pyConsole = app->pythonConsole();