Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
bitsandbytes
Commits
3cefd82d
Unverified
Commit
3cefd82d
authored
Jan 23, 2024
by
Korytov Pavel
Committed by
GitHub
Jan 23, 2024
Browse files
Quote folder and filename in find_file_recursive (#975)
parent
3e69e8fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
bitsandbytes/__main__.py
bitsandbytes/__main__.py
+2
-1
No files found.
bitsandbytes/__main__.py
View file @
3cefd82d
...
@@ -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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment