Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【BUG】依赖路径判断条件不完备 #68406

Open
Tpinion opened this issue Sep 24, 2024 · 2 comments
Open

【BUG】依赖路径判断条件不完备 #68406

Tpinion opened this issue Sep 24, 2024 · 2 comments
Assignees

Comments

@Tpinion
Copy link

Tpinion commented Sep 24, 2024

问题代码

if hasattr(site, 'USER_SITE'):

详细描述

site.USER_SITE的取值可能为None,继而导致path join时候异常。
image
Python官方文档

触发背景

在不适合将python深入嵌入操作系统的情况下,解释器以及其对应依赖路径都是动态设置的情况下,site.USER_SITE可能是未设置的。

解决方式

增加判断条件if hasattr(site, 'USER_SITE') and site.USER_SITE:

@wangguan1995
Copy link

收到,正在联系对应接口人进行审核

@wangguan1995
Copy link

@zbt78

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants