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

fix p7zip-rar error and files with ' or " by using arg lists instead of strings #633

Merged
merged 14 commits into from
Dec 21, 2023

Conversation

axu2
Copy link
Collaborator

@axu2 axu2 commented Dec 3, 2023

Not using the slightly unsafe shell=True parameter will actually throw a FileNotFoundError if I call a command that doesn't exist (like if kindlegen or 7z aren't installed). Called out explicitly here:

https://docs.python.org/3/library/subprocess.html#exceptions

So prior code in #581 actually crashed when 7z and kindlegen aren't installed during the initial check. Our code prevent selecting MOBI/zip formats afterward, so no further exceptions expected.

So added try: except blocks as needed during initial checks.

@axu2 axu2 changed the title Popen fix p7zip-rar error and files with ' or " by using arg lists instead of strings Dec 3, 2023
@axu2 axu2 closed this Dec 7, 2023
@axu2 axu2 reopened this Dec 8, 2023
@axu2 axu2 marked this pull request as ready for review December 10, 2023 00:01
@axu2
Copy link
Collaborator Author

axu2 commented Dec 10, 2023

Also removed some utf-8 encodings since it caused crashes on files with non utf8 characters.

Now it only encodes utf8 in the same places originally.

@axu2 axu2 merged commit 3988f20 into ciromattia:master Dec 21, 2023
@axu2 axu2 deleted the popen branch December 21, 2023 20:52
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