We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1ab7925 commit 7653e45Copy full SHA for 7653e45
src/app/main.cpp
@@ -1390,7 +1390,7 @@ int main( int argc, char *argv[] )
1390
//replace backslashes with forward slashes
1391
pythonfile.replace( '\\', '/' );
1392
#endif
1393
- QgsPythonRunner::run( QStringLiteral( "exec(open('%1').read())" ).arg( pythonfile ) );
+ QgsPythonRunner::run( QStringLiteral( "with open('%1','r') as f: exec(f.read())" ).arg( pythonfile ) );
1394
}
1395
1396
/////////////////////////////////`////////////////////////////////////
0 commit comments