-
Notifications
You must be signed in to change notification settings - Fork 42
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
Workaround to get parsepatch to run on alpine #399
Conversation
@@ -36,7 +36,7 @@ def load_hgmo_patch(diff): | |||
resp = requests.get(url) | |||
resp.raise_for_status() | |||
|
|||
patch = Patch.parse_patch(resp.content, skip_comments=False) | |||
patch = Patch.parse_patch(resp.content.decode("utf-8"), skip_comments=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be better to ignore possible decoding errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not resp.text
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that works too, it should be equivalent to resp.content.decode("utf-8", "replace").
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i tested in alpine, that works nicely, thanks @jcristau !
@@ -36,7 +36,7 @@ def load_hgmo_patch(diff): | |||
resp = requests.get(url) | |||
resp.raise_for_status() | |||
|
|||
patch = Patch.parse_patch(resp.content, skip_comments=False) | |||
patch = Patch.parse_patch(resp.content.decode("utf-8"), skip_comments=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
patch = Patch.parse_patch(resp.content.decode("utf-8"), skip_comments=False) | |
patch = Patch.parse_patch(resp.content.decode("utf-8", "ignore"), skip_comments=False) |
Followup of #398
Reported upstream on mozilla/parsepatch#11