CYGWIN: Python-3.16.0a1 doesn't select correct strerror_r()
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 60/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- c
研究方向
此錯誤位於 Python/fileutils.c 中的 _Py_strerror,第 3319 行附近的前置處理器區塊會在 Py_STRERROR_R_GNU 與 XSI 變體之間做選擇,而第 3353 和 3373 行附近的兩個 strerror_r 呼叫在 Cygwin 上無法編譯。請閱讀該功能偵測區塊以及回報者提出的 __CYGWIN__ 條件,然後檢查 configure.ac 是否已經偵測 strerror_r 的簽章。完成的標準是:Cygwin 建置能夠編譯且沒有 int-conversion 錯誤,並在該平台上選擇 GNU 分支。
由索引模型根據 Issue 內容生成。
描述
Bug report
Python-3.16.0a1 has been released, so I tried to build it on Cygwin.
Unfortunately, this error happens:
Python-3.16.0a1/Python/fileutils.c: In function ‘_Py_strerror’:
Python-3.16.0a1/Python/fileutils.c:3353:15: error: initialization of ‘int’ from ‘char *’ makes integer from pointer without a cast [-Wint-conversion]
3353 | int len = strerror_r(code, small_buffer, buflen);
| ^~~~~~~~~~
Python-3.16.0a1/Python/fileutils.c:3373:17: error: assignment to ‘int’ from ‘char *’ makes integer from pointer without a cast [-Wint-conversion]
3373 | len = strerror_r(code, buffer, buflen);
| ^
make: *** [Makefile:3361: Python/fileutils.o] Error 1
I'm thinking that this error comes from a recent change because I had not it in the past builds.
Evidently, Cygwin is also using the GNU version of strerror_r() but the current code doesn't take care of it.
At the moment, I fixed the error with this change:
--- origsrc/Python-3.16.0a1/Python/fileutils.c 2026-10-13 17:05:54.000000000 +0200
+++ src/Python-3.16.0a1/Python/fileutils.c 2026-11-02 13:13:18.366198700 +0100
@@ -3319,7 +3319,7 @@ _Py_strerror(int code)
// Check which strerror_r() API is used
# if defined(__GLIBC__) && !((_POSIX_C_SOURCE >= 200112L) && !defined(_GNU_SOURCE))
# define Py_STRERROR_R_GNU
-# elif defined(__ANDROID__) && defined(_GNU_SOURCE)
+# elif (defined(__ANDROID__) || defined(__CYGWIN__)) && defined(_GNU_SOURCE)
# define Py_STRERROR_R_GNU
# endif
#endif
However, is there a special reason because this test is not done at configure time?
Any comments?
See also issue #149879 "Enhance Cygwin support".
CPython versions tested on:
3.16
Operating systems tested on:
Windows
- 主要語言
- Python
- 星號
- 77.8k
- 分支
- 37.7k
- 平均合併
- 17 小時 24 分鐘
- 30 天內合併 PR
- 716
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
python/cpython 的其他 Issue
-
What's New in 3.12 credits the unstable C API tier to PEP 697 instead of PEP 689可能已有人在做 @TheLouisMahdi 於 1 天前認領。 未關閉docs
難度 1/5 1 小時以內 新手友好度 82/100
python/cpython#161078 · 3 則留言 ·
維護者通常 1 天內回覆
-
OS-windows type-bug
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
docs
難度 2/5 1-3 小時 新手友好度 72/100
python/cpython#161007 · 4 則留言 ·
維護者通常 1 天內回覆
-
Null dereferencing of a pointer in initconfig.c可能已有人在做 @lazerg 於 4 天前認領。 未關閉interpreter-core topic-C-API type-bug
難度 2/5 1-3 小時 新手友好度 72/100
python/cpython#160962 · 4 則留言 ·
維護者通常 1 天內回覆
-
tests topic-profiling type-bug
難度 2/5 1-3 小時 新手友好度 76/100
python/cpython#160881 · 1 則留言 ·
維護者通常 1 天內回覆
相似的 Issue
-
難度 1/5 1-3 小時 新手友好度 78/100
QuantConnect/Documentation#2838 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 70/100
awslabs/route53-dynamic-dns-with-lambda#67 · 1 則留言 ·
-
`SubAgents` returns a child run's `DeferredToolRequests` to the parent as a successful tool result未關閉bug pkg:harness
難度 2/5 1-3 小時 新手友好度 70/100
pydantic/pydantic-ai#12405 ·
維護者通常 1 天內回覆
-
good first issue help wanted
難度 2/5 1-3 小時 新手友好度 78/100
-
good first issue help wanted
難度 1/5 1 小時以內 新手友好度 82/100