问题描述
我要了
进程完成,退出代码 -107341571 (0xC00000FD)
在相当大的代码库中没有堆栈跟踪或任何其他错误指示.
With no stack trace, or any other indication of an error, in a rather large code-base.
我无法创建可重现的,否则我将能够解决这个问题.
I can't create a reproducible, or I would be able to solve this.
这是什么原因?
推荐答案
对我来说,这发生在某个类中的以下代码中:
For me, this happened with the following code in some class:
class A():
@property
def points_limits(self):
return self.points_limits
调用 a.points_limits
会导致 Python 崩溃.
Calling a.points_limits
crashed Python.
这是一个明显的名称冲突,我预计在这种情况下会出现一些编译错误,但显然没有发现.
This is an obvious name-clash, and I expected some compilation error in such cases, but apperantly this is not caught.
解决方法:
不要在自身内部调用属性 - 而是返回一个成员变量,注意前导下划线:
Solution:
don't call a property within itself - return a member variable instead, notice the leading underscore:
@property
def points_limits(self):
return self._points_limits
为什么没有更多指示性的东西,或者为什么 Google 没有找到这个 超出我的范围.
我发布此内容是为了让 Google 可搜索,从而为人们节省无数时间.
I am posting this to save countless hours for people by making this google-searchable.
这篇关于进程完成,退出代码 -107341571 (0xC00000FD)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!