[issue28752] datetime object fails to restore from reduction

2017-03-31 Thread Donald Stufft
Changes by Donald Stufft : -- pull_requests: +906 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue28752] datetime object fails to restore from reduction

2016-11-22 Thread Jason R. Coombs
Jason R. Coombs added the comment: Thanks all! So pleased to see this fixed. -- ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue28752] datetime object fails to restore from reduction

2016-11-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: It looks like Serhiy has already committed it. Thanks! -- ___ Python tracker ___ ___ Python-b

[issue28752] datetime object fails to restore from reduction

2016-11-21 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker ___

[issue28752] datetime object fails to restore from reduction

2016-11-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0a2a0061e425 by Serhiy Storchaka in branch '3.6': Issue #28752: Restored the __reduce__() methods of datetime objects. https://hg.python.org/cpython/rev/0a2a0061e425 New changeset 23140bd66d86 by Serhiy Storchaka in branch 'default': Issue #28752: R

[issue28752] datetime object fails to restore from reduction

2016-11-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > If you can push this in the next hour or two ... I'll do it now. -- ___ Python tracker ___

[issue28752] datetime object fails to restore from reduction

2016-11-21 Thread Ned Deily
Ned Deily added the comment: If you can push this in the next hour or two, it can still make b4. -- ___ Python tracker ___ ___ Python-

[issue28752] datetime object fails to restore from reduction

2016-11-21 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +ned.deily ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue28752] datetime object fails to restore from reduction

2016-11-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The patch LGTM. I'll commit it tonight unless Serhiy beats me to it. -- nosy: +alexandre.vassalotti, haypo, tim.peters ___ Python tracker ___

[issue28752] datetime object fails to restore from reduction

2016-11-21 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- assignee: -> belopolsky stage: patch review -> commit review ___ Python tracker ___ ___ Python-b

[issue28752] datetime object fails to restore from reduction

2016-11-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > On Nov 20, 2016, at 12:34 PM, Serhiy Storchaka wrote: > > The only way is to define both __reduce_ex__ and __reduce__ for time and > datewtime. OK. I'll review your patch and get it committed shortly. -- _

[issue28752] datetime object fails to restore from reduction

2016-11-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Other way is to define __reduce_ex__ instead of __reduce__ in datetime.date. Sorry, I was wrong. This would wouldn't work with C implementation. And explicitly setting __reduce__ = object.__reduce__ doesn't work. The only way is to define both __reduce_ex_

[issue28752] datetime object fails to restore from reduction

2016-11-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > On Nov 20, 2016, at 11:10 AM, Serhiy Storchaka wrote: > > Other way is to define __reduce_ex__ instead of __reduce__ in datetime.date. I would prefer this solution. -- ___ Python tracker

[issue28752] datetime object fails to restore from reduction

2016-11-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Proposed patch restores the __reduce__() methods and makes Python and C implementations more consistent. -- keywords: +patch stage: -> patch review Added file: http://bugs.python.org/file45564/datetime-reduce.patch __

[issue28752] datetime object fails to restore from reduction

2016-11-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Now pickling of the datetime.datetime objects is implemented with __reduce_ex__. __reduce__ is not defined in datetime.datetime and is inherited from datetime.date. >>> datetime.datetime.__reduce_ex__ >>> datetime.datetime.__reduce__ __reduce_ex__ has hig

[issue28752] datetime object fails to restore from reduction

2016-11-20 Thread Jason R. Coombs
Jason R. Coombs added the comment: Pickle still works, so pickle must be relying on a different protocol for serialization. $ python Python 3.6.0b3 (v3.6.0b3:8345e066c0ed, Oct 31 2016, 18:05:23) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "licen

[issue28752] datetime object fails to restore from reduction

2016-11-20 Thread Jason R. Coombs
New submission from Jason R. Coombs: On Python 3.5, the datetime would reduce and restore cleanly. $ python3.5 -c "import datetime; func, params = datetime.datetime.now().__reduce__(); func(*params)" With Python 3.6.0b3, it now fails with a TypeError. $ python3.6 -c "import datetime; func, pa