Closed SeanTConrad closed 1 month ago
This pull request addresses an issue with Unicode decoding errors during the execution of subprocess commands. The implementation adds a retry mechanism that attempts to re-execute the command with error handling for Unicode issues.
Files | Changes |
---|---|
src/verinfast/utils/utils.py |
Introduced a retry mechanism in the std_exec function to handle UnicodeDecodeError by re-executing the command with shell=True and 'replace' error handling in the decode method. |
Why not just do the replace in the first call.
I'm not super familiar with what "replace" does, so I was trying not to impact the "happy path." If you think the "replace" is safe, I can collapse/ do it in the first call.
Why not just do the replace in the first call.
I went ahead and changed it.
Why are these changes needed?
Another user had this issue in their logs:
I haven't thought of a way to reproduce, so it's tough to test. I think it's a Windows' carriage return in a commit message.
Related issue number
Checks
Summary by Sourcery
This pull request addresses an issue where the std_exec function fails to decode output due to Unicode errors. A retry mechanism has been added to handle these errors by re-executing the command with error replacement, improving robustness in handling encoding issues.