Title: tell() is incorrect after read_bytes() · Issue #426 · msgpack/msgpack-python · GitHub
Open Graph Title: tell() is incorrect after read_bytes() · Issue #426 · msgpack/msgpack-python
X Title: tell() is incorrect after read_bytes() · Issue #426 · msgpack/msgpack-python
Description: Using the default ._cmsgpack implementation of an Unpacker, you will get the wrong answer if you call tell() after read_bytes(). Here's a simple repro: import msgpack from io import BytesIO buf = BytesIO(b'my data') u = msgpack.Unpacker(...
Open Graph Description: Using the default ._cmsgpack implementation of an Unpacker, you will get the wrong answer if you call tell() after read_bytes(). Here's a simple repro: import msgpack from io import BytesIO buf = B...
X Description: Using the default ._cmsgpack implementation of an Unpacker, you will get the wrong answer if you call tell() after read_bytes(). Here's a simple repro: import msgpack from io import BytesIO buf...
Opengraph URL: https://github.com/msgpack/msgpack-python/issues/426
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"tell() is incorrect after read_bytes()","articleBody":"Using the default `._cmsgpack` implementation of an `Unpacker`, you will get the wrong answer if you call `tell()` after `read_bytes()`. Here's a simple repro:\r\n\r\n```\r\nimport msgpack\r\nfrom io import BytesIO\r\nbuf = BytesIO(b'my data')\r\nu = msgpack.Unpacker(buf)\r\nprint(u.tell())\r\nu.read_bytes(5)\r\nprint(u.tell())\r\n```\r\n\r\nAfter calling `u.read_bytes(5)`, `u.tell()` will still return 0. It looks like the `stream_offset` in `_unpacker.pyx` should be advanced in `read_bytes()`, but is currently only advanced by `_unpack()`.\r\n\r\nNote that this works correctly in the `.fallback` implementation, so a quick workaround is to use `import msgpack.fallback as msgpack`, but I assume this is much slower than the C implementation.","author":{"url":"https://github.com/eddyashton","@type":"Person","name":"eddyashton"},"datePublished":"2020-06-04T13:39:26.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/426/msgpack-python/issues/426"}
| 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:8f26c613-dbe8-293e-a2e1-05e2e6de2f28 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A81A:2C03D:160F9:1F6A1:6A4E60F7 |
| html-safe-nonce | 3f57ecbc094d6dd2f4d094cb87e97892306e4a2f536a94920a5129b9170301e0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBODFBOjJDMDNEOjE2MEY5OjFGNkExOjZBNEU2MEY3IiwidmlzaXRvcl9pZCI6IjIxMzYwNTEzMTg3MTk5MzA2MTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 385b333101df261c19fb975b5c37fafef1e448074922360b372a643e098bab6e |
| hovercard-subject-tag | issue:630834244 |
| 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/msgpack/msgpack-python/426/issue_layout |
| twitter:image | https://opengraph.githubassets.com/aa8340106dd42943f0acc55fcac0ba1dcca80fea984ec913ca3eecb7fe6392f4/msgpack/msgpack-python/issues/426 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/aa8340106dd42943f0acc55fcac0ba1dcca80fea984ec913ca3eecb7fe6392f4/msgpack/msgpack-python/issues/426 |
| og:image:alt | Using the default ._cmsgpack implementation of an Unpacker, you will get the wrong answer if you call tell() after read_bytes(). Here's a simple repro: import msgpack from io import BytesIO buf = B... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | eddyashton |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| turbo-cache-control | no-preview |
| go-import | github.com/msgpack/msgpack-python git https://github.com/msgpack/msgpack-python.git |
| octolytics-dimension-user_id | 198264 |
| octolytics-dimension-user_login | msgpack |
| octolytics-dimension-repository_id | 2242705 |
| octolytics-dimension-repository_nwo | msgpack/msgpack-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 2242705 |
| octolytics-dimension-repository_network_root_nwo | msgpack/msgpack-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 | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width