Side effects on locale and timezone when importing `extractcode.libarchive2` as library
還沒有人認領這個 Issue。
評估
研究方向
檢查 src/extractcode/libarchive2.py 的第 135-143 行,並在使用該模組進行擷取時重現時區和 locale 的變更。為呼叫端在使用前後的 locale 和時區新增單元測試涵蓋範圍,然後驗證測試表明使用函式庫不再全域變更它們。
由索引模型根據 Issue 內容生成。
描述
Importing extractcode.libarchive2 has unexpected side effects on the caller, especially when used as a library inside a larger project.
In my specific case, the base application is running with the Europe/Berlin timezone, as this is my local time. After having executed some extraction code involving the aforementioned module, my timezone is set to UTC. This only became obvious because my logging showed that processing the archive finished nearly two hours before starting the process.
The reason is https://github.com/aboutcode-org/extractcode/blob/db9dd083239302220b996bcf9c1914cd5c3ff016/src/extractcode/libarchive2.py#L135-L143 In my opinion, libraries should not change such stuff globally without any warning.
Edit: It seems like these aspects are not covered by unit tests as well, which makes evaluating alternatives or removing these lines harder.
- 主要語言
- Python
- 星號
- 39
- 分支
- 23
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
aboutcode-org/extractcode 的其他 Issue
-
難度 3/5 1-2 天 新手友好度 68/100
aboutcode-org/extractcode#77 ·
-
難度 3/5 1-2 天 新手友好度 45/100
aboutcode-org/extractcode#75 · 2 則留言 ·
-
難度 4/5 3-5 天 新手友好度 35/100
aboutcode-org/extractcode#73 · 4 個 reaction ·
-
QA Failure for vmimage extractor (vmimage.py): libguestfs configuration on Ubuntu可能已有人在做 @ArkaprabhaChakraborty 於 642 天前認領。 未關閉
難度 3/5 1-2 天 新手友好度 35/100
aboutcode-org/extractcode#69 · 2 則留言 ·
-
難度 3/5 1-2 天 新手友好度 45/100
aboutcode-org/extractcode#66 ·
查看 aboutcode-org/extractcode 的全部 Issue
相似的 Issue
-
changelog investigate
難度 2/5 1-3 小時 新手友好度 67/100
ramnes/notion-sdk-py#433 ·
-
docs pkg:core
難度 1/5 1 小時以內 新手友好度 84/100
pydantic/pydantic-ai#11929 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
intake/intake-esm#789 ·
-
難度 2/5 1-3 小時 新手友好度 82/100
MemMachine/MemMachine#1877 ·
維護者通常 3 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
openedx/openedx-authz#579 ·
維護者通常 1 天內回覆