"vscode:/vscode.git/clone" did not exist on "bb4337b34c13fd704d8fd1afca30e22e1dbd9da7"
Unverified Commit bd292be0 authored by Richard Zou's avatar Richard Zou Committed by GitHub
Browse files

[BugFix] Python file source reading can fail on UnicodeDecodeError (#32416)


Signed-off-by: default avatarRichard Zou <zou3519@gmail.com>
parent 41c544f7
...@@ -606,7 +606,7 @@ class VllmBackend: ...@@ -606,7 +606,7 @@ class VllmBackend:
try: try:
with open(filepath) as f: with open(filepath) as f:
hash_content.append(f.read()) hash_content.append(f.read())
except OSError: except (OSError, UnicodeDecodeError):
logger.warning("Failed to read file %s", filepath) logger.warning("Failed to read file %s", filepath)
continue continue
code_hash = hashlib.sha256("\n".join(hash_content).encode()).hexdigest() code_hash = hashlib.sha256("\n".join(hash_content).encode()).hexdigest()
......
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