Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json_data: Eliminate utf_path #3085

Merged
merged 1 commit into from
Nov 23, 2019
Merged

json_data: Eliminate utf_path #3085

merged 1 commit into from
Nov 23, 2019

Conversation

ferdnyc
Copy link
Contributor

@ferdnyc ferdnyc commented Nov 20, 2019

The os.fsencode() conversion and the use of utf_path is causing exceptions when mixing and matching regular expressions applied to utf_path and path:

   json_data:ERROR Error while converting relative paths to absolute paths:
 a bytes-like object is required, not 'str'

path will be a str which is already Unicode, there's no reason to apply conversions.

Also removed the re.UNICODE flag from the regular expression, as it's deprecated and ignored:

Note that for backward compatibility, the re.U flag still exists (as well as its synonym re.UNICODE and its embedded counterpart (?u)), but these are redundant in Python 3 since matches are Unicode by default for strings (and Unicode matching isn’t allowed for bytes).

@ferdnyc
Copy link
Contributor Author

ferdnyc commented Nov 23, 2019

Turns out this fixes #3094 (who knew?!?), merging.

@ferdnyc ferdnyc merged commit 5ca13a8 into OpenShot:develop Nov 23, 2019
@ferdnyc ferdnyc deleted the json-paths branch November 23, 2019 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant