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 to decode bytes to unicode in server when reading file from disk #7610

Merged
merged 6 commits into from Apr 26, 2019

Conversation

Projects
None yet
2 participants
@illicitonion
Copy link
Contributor

commented Apr 23, 2019

json.dumps raises if dict values are bytes.

@illicitonion illicitonion requested a review from Eric-Arellano Apr 23, 2019

@Eric-Arellano
Copy link
Contributor

left a comment

This reporter code is the worst with unicode - I hate how much we use bytes in it, but am afraid to touch until dropping Py2.

Could you please expand the PR description with the motivation? Is this to fix the Cron job eg https://travis-ci.org/pantsbuild/pants/jobs/522402485?

Also, if you haven't already, would be great to run the relevant command and/or test with both ./pants2 and ./pants. I would, but don't know the command to use.

Thanks!

@Eric-Arellano

This comment has been minimized.

Copy link
Contributor

commented Apr 23, 2019

Also the PR title suggests this does more than it actually does. I recommend rewording to Fix server bug by decoding bytes into unicode when interpreting the content.

We want to make clear this is not a feature change or major refactor, but rather a small bugfix.

@illicitonion illicitonion changed the title Decode bytes to unicode in server Decode bytes to unicode in server when reading file from disk Apr 24, 2019

@illicitonion illicitonion changed the title Decode bytes to unicode in server when reading file from disk Fix to decode bytes to unicode in server when reading file from disk Apr 24, 2019

@illicitonion

This comment has been minimized.

Copy link
Contributor Author

commented Apr 24, 2019

Added a unit test which fails without this change, re-titled.

@Eric-Arellano
Copy link
Contributor

left a comment

Thanks for adding a test!

Show resolved Hide resolved tests/python/pants_test/reporting/test_reporting.py Outdated
Show resolved Hide resolved tests/python/pants_test/reporting/test_reporting.py Outdated

illicitonion added some commits Apr 24, 2019

@Eric-Arellano
Copy link
Contributor

left a comment

Can you please link to #6071 for discoverability that we need to remove this? Thanks!

@illicitonion illicitonion merged commit 55ddc9e into pantsbuild:master Apr 26, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@illicitonion illicitonion deleted the twitter:dwagnerhall/server/decode branch Apr 26, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.