Skip to content

Commit

Permalink
Quote folder and filename in find_file_recursive (#975)
Browse files Browse the repository at this point in the history
  • Loading branch information
SqrtMinusOne authored Jan 23, 2024
1 parent 3e69e8f commit 3cefd82
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bitsandbytes/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def execute_and_return_decoded_std_streams(command_string):
return std_out, std_err

def find_file_recursive(folder, filename):
folder = shlex.quote(folder)
filename = shlex.quote(filename)
cmd = f'find {folder} -name {filename}'
out, err = execute_and_return(cmd)
if len(err) > 0:
Expand Down Expand Up @@ -151,4 +153,3 @@ def print_debug_info() -> None:
print(e)
print_debug_info()
sys.exit(1)

0 comments on commit 3cefd82

Please sign in to comment.