You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Windows 原生环境下后端导入失败:模块级引用 POSIX-only 依赖(fcntl / os.O_DIRECTORY) #1097
File "...backend\package\yuxi\workspace\__init__.py", line 3, in <module>
from .filesystem import Workspace
File "...backend\package\yuxi\workspace\filesystem.py", line 12, in <module>
from yuxi.utils.paths import open_directory_fd, open_regular_file_fd
File "...backend\package\yuxi\utils\paths.py", line 8, in <module>
_DIRECTORY_OPEN_FLAGS = os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW
AttributeError: module 'os' has no attribute 'O_DIRECTORY'
量化验证:将 paths.py:8 的常量临时改为 getattr 兜底后执行 pytest test/unit --collect-only,结果为 1197 个用例收集成功、94 个收集错误,其中 83 个为 ModuleNotFoundError: No module named 'fcntl'(projection.py),1 个为 os.O_DIRECTORY(test_paths.py),其余 10 个为 No module named 'test.performance' 等 test 包内导入错误(未进一步定位)。
3️⃣ 相关截图
无
4️⃣ 其他相关信息
README 快速开始包含 Windows PowerShell 初始化步骤(.\scripts\init.ps1)。若 Windows 原生开发不在支持范围(开发与测试均通过 Docker 容器进行),该问题也可以按文档说明处理;若希望至少导入不失败,可能的处理方式包括将常量改为 getattr(os, "O_DIRECTORY", 0) 形式的兜底定义、fcntl 改为函数内按需导入等。
Activity