当我easy_install
一些python模块时,警告如:
<some module>: module references __file__
<some module>: module references __path__
<some module>: module MAY be using inspect.trace
<some module>: module MAY be using inspect.getsourcefile
有时会被发射。
这些消息来自哪里(什么包/源文件)?为什么引用 __file__
或 __path__
被认为是一件坏事?
最佳答案
easy_install
不喜欢使用 __file__
和 __path__
并不是因为它们很危险,而是因为几乎使用它们的软件包压缩鸡蛋总是用不完。
easy_install
发出警告,因为它将“效率较低”地安装到解压缩的目录而不是压缩的鸡蛋中。
在实践中,当 zip_safe 检查失败时,我通常会很高兴,因为那样的话,如果我需要深入研究模块的源代码,那就容易多了。
关于python - 'easy_install' 期间发出的警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2298403/