-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fsdecode as a wrapper for os.fsdecode and clean filename handling
os.fsdecode was introduced in python 3.2, so I implemented fsdecode in utils.py to be able to use it on previous versions. fsdecode thus returns the filename passed as parameter as a unicode string (either if it's str or bytes), and if a PathLike object is used, it returns its filename. In other case, it raises a TypeError exception. Changed code in from_file and mediainfo_json to use it, which simplifies the code a bit and hopefully fixes the last windows appveyor error.
- Loading branch information
Showing
2 changed files
with
33 additions
and
24 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