-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed probing and editing paths w/ weird encoding
`probe_files()` now uses `encoding='utf-8'` and `errors='ignore'` while reading/writing to match FFmpeg/FFprobe's output. The `.communicate()` call is now done within the try-except block for extra safety. All probe files `open()` calls now also specify `encoding='utf-8'` as well (but do not ignore errors, so invalid probes can be replaced or examined). Also, `Edit.ffmpeg()` now parses progress lines within its nearby try-except block as well, defaulting to an empty list on errors to avoid crashing when a line cannot be parsed. For one last line of defense, `util.ffmpeg_async()` now also uses `encoding='utf-8'` and `errors='ignore'` itself, which likely stops the progress lines from ever erroring out in the first place. This is probably a reason to start saving and reading probes in bytes rather than text. Also, I couldn't get logging to work, even with `encoding` and `errors` parameters. It just never works (which is kinda fine actually since we're still compiling for 3.8, which didn't have those parameters for logging yet).
- Loading branch information
1 parent
4479999
commit 4b28d9e
Showing
2 changed files
with
17 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters