[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-03-31 Thread Donald Stufft

Changes by Donald Stufft :


--
pull_requests: +1108

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-03-28 Thread STINNER Victor

STINNER Victor added the comment:

m-parry reported the issue #29921 "datetime validation is stricter in 3.6.1 
than previous versions". He is right, the C API of Python 3.6.1 is now stricter 
than Python 2.7 and 3.5. The C API doesn't allow anymore to create datetime 
objects outside the [datetime.datetime.min; datetime.datetime.max] range (what 
I would call "invalid" datetime objects). I closed the bug as NOT A BUG since I 
consider that it's a deliberate design choice and not a regression.

--

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-02-10 Thread Roundup Robot

Roundup Robot added the comment:


New changeset be363764cad68ad7b608ceed837cc01c2c3b4efc by Victor Stinner in 
branch '3.6':
Fix test_datetime on Windows
https://github.com/python/cpython/commit/be363764cad68ad7b608ceed837cc01c2c3b4efc


--

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-02-10 Thread Roundup Robot

Roundup Robot added the comment:


New changeset be363764cad68ad7b608ceed837cc01c2c3b4efc by Victor Stinner in 
branch 'master':
Fix test_datetime on Windows
https://github.com/python/cpython/commit/be363764cad68ad7b608ceed837cc01c2c3b4efc


--

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-02-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1555e7776321 by Victor Stinner in branch '3.6':
Fix test_datetime on Windows
https://hg.python.org/cpython/rev/1555e7776321

--

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-02-10 Thread Roundup Robot

Roundup Robot added the comment:


New changeset a88f9614c672c3369cf03cdf51d012a42ae5665f by Victor Stinner in 
branch 'master':
Fix test_datetime on system with 32-bit time_t
https://github.com/python/cpython/commit/a88f9614c672c3369cf03cdf51d012a42ae5665f


--

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-02-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1c6b87b07586 by Victor Stinner in branch '3.6':
Fix test_datetime on system with 32-bit time_t
https://hg.python.org/cpython/rev/1c6b87b07586

--

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-02-10 Thread Roundup Robot

Roundup Robot added the comment:


New changeset 5b804b2fb0eaa2bacb4afcfe4cfa85b31475e87f by Victor Stinner in 
branch 'master':
Fix datetime.fromtimestamp(): check bounds
https://github.com/python/cpython/commit/5b804b2fb0eaa2bacb4afcfe4cfa85b31475e87f


--

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-02-10 Thread Roundup Robot

Roundup Robot added the comment:


New changeset 5b804b2fb0eaa2bacb4afcfe4cfa85b31475e87f by Victor Stinner in 
branch '3.6':
Fix datetime.fromtimestamp(): check bounds
https://github.com/python/cpython/commit/5b804b2fb0eaa2bacb4afcfe4cfa85b31475e87f


--

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-02-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 383c0238b5b0 by Victor Stinner in branch '3.6':
Fix datetime.fromtimestamp(): check bounds
https://hg.python.org/cpython/rev/383c0238b5b0

--
nosy: +python-dev

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-02-10 Thread STINNER Victor

STINNER Victor added the comment:

I pushed  timestamp_limits-2.patch. Thanks for the bug report Jordon Phillips, 
thanks for the review Serhiy Storshaka.

--
resolution:  -> fixed
stage:  -> 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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-01-27 Thread STINNER Victor

STINNER Victor added the comment:

timestamp_limits-2.patch: catch also OverflowError in unit tests, and uses a 
context manager rather than self.assertRaises(..., func, ...) syntax.

--
Added file: http://bugs.python.org/file46437/timestamp_limits-2.patch

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-01-27 Thread STINNER Victor

STINNER Victor added the comment:

timestamp_limits.patch is waiting for your review! This issue is a major 
regression of Python 3.6. I'm going to push the patch in one week if I don't 
get any review.

--

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-01-27 Thread STINNER Victor

STINNER Victor added the comment:

The issue #29346 has been marked as a duplicate of this one.

--

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-01-27 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +Eli Collins, lemburg

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-01-04 Thread STINNER Victor

STINNER Victor added the comment:

timestamp_limits.patch: Add many checks in the _datetime module to avoid 
overflows or creating a object out of the range. The patch adds unit tests.

The unit test checks dates around year 1 and year . I expect failures on 
platforms which only work well on year in the range 1970..2038. My plan is to 
wait for buildbot reports to check on which platforms the test fails and with 
which exception.

Since the patch is likely to break buildbots, I will apply first to the default 
branch, fix it, and then backport to Python 3.6.

--
Added file: http://bugs.python.org/file46142/timestamp_limits.patch

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-01-03 Thread STINNER Victor

STINNER Victor added the comment:

unitttest.patch: my attempt to write an unit test, but I was bitten by the 
datetime.timestamp() bug.

--
Added file: http://bugs.python.org/file46131/unittest.patch

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-01-03 Thread STINNER Victor

STINNER Victor added the comment:

Oh, datetime.datetime.timestamp() also has a bug for values close to 0001-01-01 
(year 1), at least in my timezone (CET).

$ ./python -c 'import datetime; datetime.datetime.min.timestamp()'
python: /home/haypo/prog/python/default/Modules/_datetimemodule.c:251: 
days_before_year: Assertion `year >= 1' failed.
Aborted (core dumped)

datetime_check_args.patch doesn't fix this issue. A solution is to check that 
year>=1 in utc_to_seconds():

+if (year < MINYEAR || year > MAXYEAR) {
+PyErr_SetString(PyExc_ValueError,
+"year is out of range");
+return -1;
+}

Maybe it would solve the following local() comment:

   /* XXX: add bounds checking */

--

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-01-03 Thread STINNER Victor

Changes by STINNER Victor :


--
title: datetime.fromtimestamp() does crash for very small or very big timestamp 
-> datetime.fromtimestamp() doesn't check min/max year anymore: regression of 
Python 3.6

___
Python tracker 

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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-01-03 Thread STINNER Victor

Changes by STINNER Victor :


--
keywords: +3.6regression

___
Python tracker 

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