We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4e5888d + 4a36874 commit c458a53Copy full SHA for c458a53
src/app/main.cpp
@@ -1386,7 +1386,7 @@ int main( int argc, char *argv[] )
1386
//replace backslashes with forward slashes
1387
pythonfile.replace( '\\', '/' );
1388
#endif
1389
- QgsPythonRunner::run( QStringLiteral( "exec(open('%1').read())" ).arg( pythonfile ) );
+ QgsPythonRunner::run( QStringLiteral( "with open('%1','r') as f: exec(f.read())" ).arg( pythonfile ) );
1390
}
1391
1392
/////////////////////////////////`////////////////////////////////////
0 commit comments