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

Ensure large numbers are encoded correctly #888

Merged
merged 2 commits into from
Nov 9, 2017
Merged

Ensure large numbers are encoded correctly #888

merged 2 commits into from
Nov 9, 2017

Conversation

lukebakken
Copy link
Member

@lukebakken lukebakken commented Oct 31, 2017

Fixes #861

The struct module throws struct.error when attempting to encode a greater-than-4-byte number using the "i" (4 byte) format. This will catch the error and promote the encoding to "q" (8 byte) format.

Fixes #861

The struct module throws struct.error when attempting to encode a greater-than-4-byte number using the "i" (4 byte) format. This will catch the error and promote the encoding to "q" (8 byte) format.
@lukebakken
Copy link
Member Author

I'm not thrilled with catching struct.error but I expect this to be a rare occasion and it seems preferable to making this comparison every time - -2147483648 <= value <= 2147483647

@lukebakken lukebakken requested a review from gmr October 31, 2017 18:57
@codecov
Copy link

codecov bot commented Oct 31, 2017

Codecov Report

Merging #888 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #888      +/-   ##
==========================================
+ Coverage   81.94%   81.99%   +0.04%     
==========================================
  Files          21       21              
  Lines        3734     3743       +9     
  Branches      554      554              
==========================================
+ Hits         3060     3069       +9     
  Misses        523      523              
  Partials      151      151
Impacted Files Coverage Δ
pika/data.py 82.85% <100%> (+0.92%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7022aa9...b98e085. Read the comment docs.

@lukebakken lukebakken merged commit a978965 into master Nov 9, 2017
@lukebakken lukebakken deleted the gh-861 branch November 9, 2017 15:22
@lukebakken lukebakken added this to the 0.11.1 milestone Nov 9, 2017
gbartl pushed a commit to gbartl/pika that referenced this pull request Jan 27, 2018
Ensure large numbers are encoded correctly
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.

None yet

2 participants