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

show readable error message when applying patch without (extracted) source #4738

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Flamefire
Copy link
Contributor

When there is no source self.src is an empty list which leads to a rather generic error message. Improve that by showing that there was no source to apply the patch to.

For extensions self.src is set to a string as only a single source is supported.
Accessing self.src[0].['finalpath'] leads to an error

TypeError: string indices must be integers
This happens when the source didn't got extracted so self.ext_dir and hence beginpath will be None.
Make the error show that the source was not extracted.

While doing that get rid of patch['source'] which can never be set as it would trigger a failure in create_patch_info as it isn't specified as an allowed key. It isn't useful anyway as only the first source will have its finalpath set correctly, the other, when unpacked to the same folder, are just referring to that folder instead of their subfolder.

…ource

When there is no source `self.src` is an empty list which leads to a
rather generic error message. Improve that by showing that there was no
source to apply the patch to.

For extensions `self.src` is set to a string as only a single source is
supported.
Accessing `self.src[0].['finalpath']` leads to an error
> TypeError: string indices must be integers
This happens when the source didn't got extracted so `self.ext_dir` and
hence `beginpath` will be `None`.
Make the error show that the source was not extracted.
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