Title: gcloud.datastore.helpers.get_protobuf_attribute_and_value() allows out-of-range long integers · Issue #132 · googleapis/google-cloud-python · GitHub
Open Graph Title: gcloud.datastore.helpers.get_protobuf_attribute_and_value() allows out-of-range long integers · Issue #132 · googleapis/google-cloud-python
X Title: gcloud.datastore.helpers.get_protobuf_attribute_and_value() allows out-of-range long integers · Issue #132 · googleapis/google-cloud-python
Description: If I construct an integer too long to encode as a 64-bit integer, get_protobuf_attribute_and_value() does not raise a ValueError: >>> gcloud.datastore.helpers.get_protobuf_attribute_and_value >>> too_long = 1 << 63 >>> get_protobuf_attri...
Open Graph Description: If I construct an integer too long to encode as a 64-bit integer, get_protobuf_attribute_and_value() does not raise a ValueError: >>> gcloud.datastore.helpers.get_protobuf_attribute_and_value >>> t...
X Description: If I construct an integer too long to encode as a 64-bit integer, get_protobuf_attribute_and_value() does not raise a ValueError: >>> gcloud.datastore.helpers.get_protobuf_attribute_and_va...
Opengraph URL: https://github.com/googleapis/google-cloud-python/issues/132
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"gcloud.datastore.helpers.get_protobuf_attribute_and_value() allows out-of-range long integers","articleBody":"If I construct an integer too long to encode as a 64-bit integer, get_protobuf_attribute_and_value() does not raise a `ValueError`:\n\n```\n\u003e\u003e\u003e gcloud.datastore.helpers.get_protobuf_attribute_and_value\n\u003e\u003e\u003e too_long = 1 \u003c\u003c 63\n\u003e\u003e\u003e get_protobuf_attribute_and_value(too_long)\n('integer_value', 9223372036854775808L)\n```\n\neven though that value is not usable for an 'integer_value' field:\n\n```\n\u003e\u003e\u003e from gcloud.datastore.datastore_v1_pb2 import Property\n\u003e\u003e\u003e pb = Property()\n\u003e\u003e\u003e pb.value.integer_value = too_long\n...\nFile \".../lib/python2.7/site-packages/google/protobuf/internal/type_checkers.py\", line 119, in CheckValue\n raise ValueError('Value out of range: %d' % proposed_value)\nValueError: Value out of range: 9223372036854775808\n```\n","author":{"url":"https://github.com/tseaver","@type":"Person","name":"tseaver"},"datePublished":"2014-09-16T15:26:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/132/google-cloud-python/issues/132"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:177e13f7-c467-3f4d-a0b0-3e98dc8812ba |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8E70:299194:10E9715:16AB0F1:6A4D8E0D |
| html-safe-nonce | 050548c0d559dc4b9572e73bdff6075d2b28ffaf7426113e661c1f0ea3f4ff69 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RTcwOjI5OTE5NDoxMEU5NzE1OjE2QUIwRjE6NkE0RDhFMEQiLCJ2aXNpdG9yX2lkIjoiNzg3MTA5NzE2NTk3MTI5NTc1NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 06f3def69b23e7df9af9f8fd81a2fd7a60a3a094c5836ec56d8eaf68f5544da8 |
| hovercard-subject-tag | issue:42895116 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/google-cloud-python/132/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d0b3255a15efae4bacf61accd2cf2c520c83c3e9eecb043ad844846e46d4e967/googleapis/google-cloud-python/issues/132 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d0b3255a15efae4bacf61accd2cf2c520c83c3e9eecb043ad844846e46d4e967/googleapis/google-cloud-python/issues/132 |
| og:image:alt | If I construct an integer too long to encode as a 64-bit integer, get_protobuf_attribute_and_value() does not raise a ValueError: >>> gcloud.datastore.helpers.get_protobuf_attribute_and_value >>> t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tseaver |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9f8758a3953dfe943439713a6fa4f90d542a3431f10e861ca03dd7f39009f320 |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/google-cloud-python git https://github.com/googleapis/google-cloud-python.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 16316451 |
| octolytics-dimension-repository_nwo | googleapis/google-cloud-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 16316451 |
| octolytics-dimension-repository_network_root_nwo | googleapis/google-cloud-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bffd5484f01713a661b03469b77678f72b6574ed |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width