mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-16 17:55:55 -05:00
fix: add explicit ValueError guard for stat output parsing
This commit is contained in:
@@ -224,7 +224,15 @@ async def extract_sandbox_files(
|
||||
)
|
||||
continue
|
||||
|
||||
file_size = int(stat_result.stdout.strip())
|
||||
try:
|
||||
file_size = int(stat_result.stdout.strip())
|
||||
except ValueError:
|
||||
logger.debug(
|
||||
f"Skipping {file_path}: unexpected stat output "
|
||||
f"{stat_result.stdout.strip()!r}"
|
||||
)
|
||||
continue
|
||||
|
||||
if file_size > MAX_BINARY_FILE_SIZE:
|
||||
logger.info(
|
||||
f"Skipping {file_path}: size {file_size} bytes "
|
||||
|
||||
Reference in New Issue
Block a user