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
crashes in multiply_float_timedelta() and in truedivide_timedelta_float() #75474
Comments
both of the following true division and multiplication operations crash the import datetime
class BadFloat(float):
def as_integer_ratio(self):
return (1 << 1000) - 1 datetime.timedelta() / BadFloat() this is because both multiply_float_timedelta() and truedivide_timedelta_float() |
i am working on a patch. BTW, is there anywhere a list of what counts as an extension |
I don't know if there is a list, but definitely the parser, the compiler, the evaluation loop, builtin types and few builtin modules (like builtins and sys) are interpreter core. The _datetime module is an accelerator of the datetime module. It is optional and definitely is not in the core. |
Please check if there is similar issue with Decimal. |
I guess you meant for me to check whether the following has any problem: class BadFloat(float):
def as_integer_ratio(self):
return 1 << 1000
decimal.Decimal.from_float(BadFloat()) so it doesn't crash. (also, the following doesn't raise an exception, as expected: class BadFloat(float):
def as_integer_ratio(self):
raise RuntimeError
decimal.Decimal.from_float(BadFloat())
) |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: