[issue35021] Assertion failures in datetimemodule.c.

2019-07-10 Thread Ned Deily


Ned Deily  added the comment:

Assuming answer to previous question is "no" -> closing

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35021] Assertion failures in datetimemodule.c.

2019-06-17 Thread Ned Deily


Ned Deily  added the comment:

Can we close this or is there anything further needed for this issue?

--
nosy: +ned.deily

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35021] Assertion failures in datetimemodule.c.

2018-11-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 40fdf471931f029ea07e6190f0fe116e0735661b by Serhiy Storchaka in 
branch '2.7':
[2.7] bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039) 
(GH-10617)
https://github.com/python/cpython/commit/40fdf471931f029ea07e6190f0fe116e0735661b


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35021] Assertion failures in datetimemodule.c.

2018-11-20 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +9863

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35021] Assertion failures in datetimemodule.c.

2018-11-20 Thread miss-islington


miss-islington  added the comment:


New changeset 7a0d964afb41bde846771c81ba746238339cdd8c by Miss Islington (bot) 
in branch '3.6':
bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039)
https://github.com/python/cpython/commit/7a0d964afb41bde846771c81ba746238339cdd8c


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35021] Assertion failures in datetimemodule.c.

2018-11-20 Thread miss-islington


miss-islington  added the comment:


New changeset d57ab8ac182d15558118523ad1b11b029e105c46 by Miss Islington (bot) 
in branch '3.7':
bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039)
https://github.com/python/cpython/commit/d57ab8ac182d15558118523ad1b11b029e105c46


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35021] Assertion failures in datetimemodule.c.

2018-11-20 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9858

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35021] Assertion failures in datetimemodule.c.

2018-11-20 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9860

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35021] Assertion failures in datetimemodule.c.

2018-11-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 3ec0f495163da3b7a15deb2805cec48aed432f58 by Serhiy Storchaka in 
branch 'master':
bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039)
https://github.com/python/cpython/commit/3ec0f495163da3b7a15deb2805cec48aed432f58


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35021] Assertion failures in datetimemodule.c.

2018-10-22 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +9378

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35021] Assertion failures in datetimemodule.c.

2018-10-22 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +9376

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35021] Assertion failures in datetimemodule.c.

2018-10-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +9305
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35021] Assertion failures in datetimemodule.c.

2018-10-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Mia culpa! I missed that the type of the right operand takes precedence when it 
is a subclass of the type of the left operand.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35021] Assertion failures in datetimemodule.c.

2018-10-18 Thread Thomas Wouters


New submission from Thomas Wouters :

The fix for issue #31752 (changeset 5ef883b096895a84123760859f0f34ad37bf2277 
for 2.7, as I ran into this while upgrading to 2.7.15) includes assertions that 
are easily triggered from user code:

>>> import datetime, numpy
>>> datetime.timedelta(seconds=numpy.int64(0))
python: .../Modules/datetimemodule.c:1859: accum: Assertion 
`_PyAnyInt_CheckExact(prod)' failed.
Aborted (core dumped)

The code asserts that the product of a known type and an unknown type is a 
known type, which is not a valid assumption. Pure-python reproducer (requires a 
build with assertions enabled, like a --with-pydebug build).

>>> import datetime
>>> class C(int):
... def __rmul__(self, other):
... return self
...
>>> datetime.timedelta(seconds=C())
python: .../Modules/datetimemodule.c:1859: accum: Assertion 
`_PyAnyInt_CheckExact(prod)' failed.
Aborted (core dumped)

(It fails in a similar way in at least Python 3.7, and since the fix was 
backported I'm going to assume 3.6 as well.)

Please do not use assertions for things that aren't guaranteed by the code 
making the assertions. These should either not be assertions, or the input 
types should be validated beforehand. I do not know why these assertions are 
being made in the first place. What do they guard against?

--
assignee: serhiy.storchaka
components: Interpreter Core
keywords: 3.6regression, 3.7regression
messages: 327989
nosy: gregory.p.smith, serhiy.storchaka, twouters
priority: high
severity: normal
stage: needs patch
status: open
title: Assertion failures in datetimemodule.c.
type: crash
versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com