Unverified Commit 3cefd82d authored by Korytov Pavel's avatar Korytov Pavel Committed by GitHub
Browse files

Quote folder and filename in find_file_recursive (#975)

parent 3e69e8fc
...@@ -31,6 +31,8 @@ def execute_and_return(command_string: str) -> Tuple[str, str]: ...@@ -31,6 +31,8 @@ def execute_and_return(command_string: str) -> Tuple[str, str]:
return std_out, std_err return std_out, std_err
def find_file_recursive(folder, filename): def find_file_recursive(folder, filename):
folder = shlex.quote(folder)
filename = shlex.quote(filename)
cmd = f'find {folder} -name {filename}' cmd = f'find {folder} -name {filename}'
out, err = execute_and_return(cmd) out, err = execute_and_return(cmd)
if len(err) > 0: if len(err) > 0:
...@@ -151,4 +153,3 @@ except Exception as e: ...@@ -151,4 +153,3 @@ except Exception as e:
print(e) print(e)
print_debug_info() print_debug_info()
sys.exit(1) sys.exit(1)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment