PEP 554: Issues with data passing and pickle
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 45/100
- Issue 類型
- 文件
- 描述清晰度
- 描述清楚
- 活躍度
- 停滯
- 技術堆疊
- python
研究方向
開啟 PEP 554 的「Passing Objects via Pickle」區段,檢查範例中的管線讀取與終止邏輯。根據顯示的 pickle 輸出驗證範例,然後更新範例,使其文件所述的行為符合預期的示範,並確認修訂後的程式碼片段可以載入 pickle 物件。
由索引模型根據 Issue 內容生成。
描述
I believe the example program given in PEP 554: https://peps.python.org/pep-0554/#passing-objects-via-pickle has some issues. It's based on a zero value (b'\x00') being a data terminator, but my attempts to recreate this (using threads instead of interpreters) showed that pickle will insert zero values in the middle of the data stream:
Python 3.10.4 (main, May 7 2022, 16:23:10) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pickle
>>> pickle.dumps("PEP 554")
b'\x80\x04\x95\x0b\x00\x00\x00\x00\x00\x00\x00\x8c\x07PEP 554\x94.'
I think the goal here is to simply demonstrate passing pickled objects through the pipe. To that end, it might make a better example to change the reading portion to read a fixed, relatively large, buffer at once and then decode that. Something like:
data = os.read(reader, 1024)
obj = pickle.loads(data)
do_something(obj)
This is clearly not a general purpose solution, but I think for an example like this, not solving all of the corner cases is OK.
Thanks for all of the tremendous work already put into this! This will be very cool!
- 主要語言
- reStructuredText
- 星號
- 5k
- 分支
- 1.8k
- 平均合併
- 1 天 15 小時
- 30 天內合併 PR
- 34
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
python/peps 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 65/100
維護者通常 1 天內回覆
-
infra
難度 3/5 1-2 天 新手友好度 55/100
python/peps#5158 · 3 個 reaction ·
維護者通常 1 天內回覆
-
New PEP Editors?未關閉meta
難度 5/5 一週以上 新手友好度 25/100
python/peps#5080 · 3 則留言 · 3 個 reaction ·
維護者通常 1 天內回覆
-
infra
難度 3/5 1-2 天 新手友好度 55/100
python/peps#4924 · 6 則留言 · 1 個 reaction ·
維護者通常 1 天內回覆
相似的 Issue
-
documentation epic:minimal-layout help wanted priority:P2
難度 2/5 半天 新手友好度 85/100
維護者通常 1 天內回覆
-
automated issue report
難度 1/5 1 小時以內 新手友好度 85/100
RapidAI/RapidOCRDocs#119 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
modelcontextprotocol/servers#5071 ·
維護者通常 1 天內回覆
-
documentation
難度 1/5 1 小時以內 新手友好度 85/100
Verifiedz/Shimmer#144 · 1 則留言 ·
維護者通常 1 天內回覆
-
changelog investigate
難度 2/5 1-3 小時 新手友好度 62/100
ramnes/notion-sdk-py#409 ·