Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ShareableList removes trailing zeroes from strings and bytes #96779

Open
@coproc

Description

@coproc

Bug report

from multiprocessing.shared_memory import ShareableLists, 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 theShareableList:sl holdsShareableList(['\x00\x01', b'\x00\x01'], name='wnsm_...'). I would expect that strings and bytes keep the trailing zeroes also when added to aShareableList.

Your environment

  • CPython versions tested on: 3.8.5, 3.10.6
  • Operating system and architecture: Windows 10, 64bit

Analysis

There are three places inclass ShareableList inLib/multiprocessing/shared_memory.py, where trailing zeroes are explicitely removed:...rstrip(b'\x00').... For what reason?

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2026 Movatter.jp