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

Conversation

Projects
None yet
2 participants
@lukebakken
Contributor

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.

Ensure large numbers are encoded correctly
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 lukebakken requested a review from michaelklishin Oct 31, 2017

@lukebakken

This comment has been minimized.

Contributor

lukebakken commented Oct 31, 2017

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 Oct 31, 2017

@codecov

This comment has been minimized.

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

6 checks passed

codecov/patch 100% of diff hit (target 81.94%)
Details
codecov/project 81.99% (+0.04%) compared to 7022aa9
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@lukebakken lukebakken deleted the gh-861 branch Nov 9, 2017

@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

Merge pull request pika#888 from pika/pikagh-861
Ensure large numbers are encoded correctly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment