Skip to content

SystemError: <built-in function compile> #141403

@zyx3721

Description

@zyx3721

Bug report

Bug description:

我发现了个神奇的事,我配置一个简单地脚本:
[root@localhost /root]# cat test.sh
wget https://xxx/Python-3.11.14.tgz
tar -xzf Python-3.11.14.tgz
cd Python-3.11.14
./configure --prefix=/usr/local/python3.11.14 --enable-shared --enable-optimizations --with-lto
make -j$(nproc)
make altinstall

然后用脚本去执行,编译报错:
./_bootstrap_python ./Programs/_freeze_module.py abc ./Lib/abc.py Python/frozen_modules/abc.h
Fatal Python error: init_import_site: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
File "/root/Python-3.11.14/Lib/site.py", line 73, in
import os
File "/root/Python-3.11.14/Lib/os.py", line 29, in
from _collections_abc import _check_methods
SystemError: returned NULL without setting an exception
make: *** [Python/frozen_modules/abc.h] Error 1

我把脚本里这几条命令拿出来手动运行,安装完全没有问题,这到底是为啥?
操作系统是CentOS Linux release 7.9.2009 (Core) 使用的默认gcc4.8.5版本

CPython versions tested on:

3.11

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.11only security fixesOS-unsupportedbuildThe build process and cross-buildpendingThe issue will be closed if no feedback is providedtype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions