Skip to content

Commit

Permalink
[app] allow to use single quote in file name passed to --code
Browse files Browse the repository at this point in the history
  • Loading branch information
agiudiceandrea authored Jan 12, 2025
1 parent 38ec9ef commit a4bae25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1650,7 +1650,7 @@ int main( int argc, char *argv[] )
//replace backslashes with forward slashes
pythonfile.replace( '\\', '/' );
#endif
QgsPythonRunner::run( QStringLiteral( "with open('%1','r') as f: exec(f.read())" ).arg( pythonfile ) );
QgsPythonRunner::run( QStringLiteral( "with open('%1','r') as f: exec(f.read())" ).arg( pythonfile.replace( QChar( '\'' ), QStringLiteral( "\\'" ) ) ) );
}

/////////////////////////////////`////////////////////////////////////
Expand Down

0 comments on commit a4bae25

Please sign in to comment.