Title: ShareableList removes trailing zeroes from strings and bytes · Issue #96779 · python/cpython · GitHub
Open Graph Title: ShareableList removes trailing zeroes from strings and bytes · Issue #96779 · python/cpython
X Title: ShareableList removes trailing zeroes from strings and bytes · Issue #96779 · python/cpython
Description: Bug report from multiprocessing.shared_memory import ShareableList s, b = '\x00\x01\x00', bytes([0,1,0]) sl = ShareableList([s, b]) s == sl[0], b == sl[1] gives (False, False) because the trailing zeroes get lost in the ShareableList: sl...
Open Graph Description: Bug report from multiprocessing.shared_memory import ShareableList s, b = '\x00\x01\x00', bytes([0,1,0]) sl = ShareableList([s, b]) s == sl[0], b == sl[1] gives (False, False) because the trailing ...
X Description: Bug report from multiprocessing.shared_memory import ShareableList s, b = '\x00\x01\x00', bytes([0,1,0]) sl = ShareableList([s, b]) s == sl[0], b == sl[1] gives (False, False) because the t...
Opengraph URL: https://github.com/python/cpython/issues/96779
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ShareableList removes trailing zeroes from strings and bytes","articleBody":"# Bug report\r\n\r\n from multiprocessing.shared_memory import ShareableList\r\n s, b = '\\x00\\x01\\x00', bytes([0,1,0])\r\n sl = ShareableList([s, b])\r\n s == sl[0], b == sl[1]\r\n\r\ngives `(False, False)` because the trailing zeroes get lost in the `ShareableList`: `sl` holds `ShareableList(['\\x00\\x01', b'\\x00\\x01'], name='wnsm_...')`. I would expect that strings and bytes keep the trailing zeroes also when added to a `ShareableList`.\r\n\r\n# Your environment\r\n\r\n- CPython versions tested on: 3.8.5, 3.10.6\r\n- Operating system and architecture: Windows 10, 64bit\r\n\r\n# Analysis\r\n\r\nThere are three places in `class ShareableList` in `Lib/multiprocessing/shared_memory.py`, where trailing zeroes are explicitely removed: `...rstrip(b'\\x00')...`. For what reason?\r\n","author":{"url":"https://github.com/coproc","@type":"Person","name":"coproc"},"datePublished":"2022-09-12T21:18:02.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/96779/cpython/issues/96779"}
| 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:313d8bae-9f21-bac6-8729-c3f5b63124d2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B1DE:2FC742:275FD3:330A54:6A52F3DB |
| html-safe-nonce | e101c16bfc1d63204f2e3fe9ca7ae16357672f64b31c2d714991b9aa87171a05 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMURFOjJGQzc0MjoyNzVGRDM6MzMwQTU0OjZBNTJGM0RCIiwidmlzaXRvcl9pZCI6IjY0OTUyODI5OTQ4OTQ1MzM1OTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 00d4b45a71f3a4baeeab3fb1ac7756f83334b7a33b01406072ece8a7abd28c9c |
| hovercard-subject-tag | issue:1370528194 |
| 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/python/cpython/96779/issue_layout |
| twitter:image | https://opengraph.githubassets.com/78c3001ce6df373cf3ae3e030dafc3b91125b7d6d872f441e4e25cba84f92a64/python/cpython/issues/96779 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/78c3001ce6df373cf3ae3e030dafc3b91125b7d6d872f441e4e25cba84f92a64/python/cpython/issues/96779 |
| og:image:alt | Bug report from multiprocessing.shared_memory import ShareableList s, b = '\x00\x01\x00', bytes([0,1,0]) sl = ShareableList([s, b]) s == sl[0], b == sl[1] gives (False, False) because the trailing ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | coproc |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| 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 | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width