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

Workaround to get parsepatch to run on alpine #399

Merged
merged 1 commit into from
Jan 7, 2020
Merged

Conversation

La0
Copy link
Collaborator

@La0 La0 commented Jan 7, 2020

Followup of #398

Reported upstream on mozilla/parsepatch#11

@La0 La0 added the bug Something isn't working label Jan 7, 2020
@La0 La0 requested a review from marco-c January 7, 2020 11:48
@La0 La0 self-assigned this Jan 7, 2020
@@ -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)
Copy link
Collaborator

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not resp.text?

Copy link
Collaborator

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").

Copy link
Collaborator Author

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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)

@La0 La0 merged commit 4d91827 into mozilla:master Jan 7, 2020
@La0 La0 deleted the fix-pp branch January 7, 2020 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants