We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
qgis
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
1 parent 1b79513 commit a8078a2Copy full SHA for a8078a2
src/app/main.cpp
@@ -1387,7 +1387,7 @@ int main( int argc, char *argv[] )
1387
//replace backslashes with forward slashes
1388
pythonfile.replace( '\\', '/' );
1389
#endif
1390
- QgsPythonRunner::run( QStringLiteral( "exec(open('%1').read())" ).arg( pythonfile ) );
+ QgsPythonRunner::run( QStringLiteral( "with open('%1','r') as f: exec(f.read())" ).arg( pythonfile ) );
1391
}
1392
1393
/////////////////////////////////`////////////////////////////////////
0 commit comments