]> granicus.if.org Git - python/log
python
9 years agoMerge with 3.4
Terry Jan Reedy [Fri, 25 Sep 2015 03:14:02 +0000 (23:14 -0400)]
Merge with 3.4

9 years agoIssue #25225: Condense and rewrite Idle doc section on text colors.
Terry Jan Reedy [Fri, 25 Sep 2015 03:13:49 +0000 (23:13 -0400)]
Issue #25225: Condense and rewrite Idle doc section on text colors.

9 years agoMerge with 3.4
Terry Jan Reedy [Thu, 24 Sep 2015 21:32:38 +0000 (17:32 -0400)]
Merge with 3.4

9 years agoIssue #25198: In Idle doc viewer, fix indent of fixed-pitch <pre> text
Terry Jan Reedy [Thu, 24 Sep 2015 21:32:01 +0000 (17:32 -0400)]
Issue #25198: In Idle doc viewer, fix indent of fixed-pitch <pre> text
by adding a new tag.  Patch by Mark Roseman. Also give <pre> text a very
light blueish-gray background similar to that used by Sphinx html.

9 years agoMerge 3.4 -> 3.5
Andrew Svetlov [Thu, 24 Sep 2015 11:35:16 +0000 (14:35 +0300)]
Merge 3.4 -> 3.5

9 years agoAdd Benjamin Hodgson to Misc/ACK
Andrew Svetlov [Thu, 24 Sep 2015 11:34:07 +0000 (14:34 +0300)]
Add Benjamin Hodgson to Misc/ACK

9 years agoFix #25208: Improve "Develop with asyncio" doc page.
Andrew Svetlov [Thu, 24 Sep 2015 11:32:39 +0000 (14:32 +0300)]
Fix #25208: Improve "Develop with asyncio" doc page.

Patch by Benjamin Hodgson.

9 years agoMerge with 3.4
Terry Jan Reedy [Thu, 24 Sep 2015 07:09:56 +0000 (03:09 -0400)]
Merge with 3.4

9 years agoIssue 21995: Explain some differences between IDLE and console Python.
Terry Jan Reedy [Thu, 24 Sep 2015 07:09:43 +0000 (03:09 -0400)]
Issue 21995: Explain some differences between IDLE and console Python.

9 years agoMerge 3.4 (codecs, issue #24894)
Victor Stinner [Thu, 24 Sep 2015 07:04:26 +0000 (09:04 +0200)]
Merge 3.4 (codecs, issue #24894)

9 years agoIssue #24894: Document the codec iso8859_11
Victor Stinner [Thu, 24 Sep 2015 07:04:05 +0000 (09:04 +0200)]
Issue #24894: Document the codec iso8859_11

Patch written by Prashant Tyagi.

9 years agoMerge with 3.4
Terry Jan Reedy [Thu, 24 Sep 2015 05:39:48 +0000 (01:39 -0400)]
Merge with 3.4

9 years agoIssue #22820: Explain need for *print* when running file from Idle editor.
Terry Jan Reedy [Thu, 24 Sep 2015 05:39:30 +0000 (01:39 -0400)]
Issue #22820: Explain need for *print* when running file from Idle editor.

9 years agoMerge with 3.4
Terry Jan Reedy [Thu, 24 Sep 2015 00:00:55 +0000 (20:00 -0400)]
Merge with 3.4

9 years agoIssue 25224: Augment Idle doc feature list and no-subprocess section
Terry Jan Reedy [Thu, 24 Sep 2015 00:00:33 +0000 (20:00 -0400)]
Issue 25224: Augment Idle doc feature list and no-subprocess section
to finish making current README.txt obsolete.

9 years agoMerge with 3.4
Terry Jan Reedy [Wed, 23 Sep 2015 07:52:36 +0000 (03:52 -0400)]
Merge with 3.4

9 years agoIssue #25219: Update doc for Idle command line options.
Terry Jan Reedy [Wed, 23 Sep 2015 07:52:23 +0000 (03:52 -0400)]
Issue #25219: Update doc for Idle command line options.
Some were missing and notes were not correct.

9 years agoMerge with 3.4
Terry Jan Reedy [Wed, 23 Sep 2015 07:45:33 +0000 (03:45 -0400)]
Merge with 3.4

9 years agoIdlelib.help: add 'b' prefix needed for bytes + bytes.
Terry Jan Reedy [Wed, 23 Sep 2015 07:45:13 +0000 (03:45 -0400)]
Idlelib.help: add 'b' prefix needed for bytes + bytes.

9 years agoIssue #12067: Merge comparisons doc from 3.4 into 3.5
Martin Panter [Wed, 23 Sep 2015 05:34:48 +0000 (05:34 +0000)]
Issue #12067: Merge comparisons doc from 3.4 into 3.5

9 years agoIssue #12067: Rewrite Comparisons section in the language reference
Martin Panter [Wed, 23 Sep 2015 05:28:13 +0000 (05:28 +0000)]
Issue #12067: Rewrite Comparisons section in the language reference

Some of the details of comparing mixed types were incorrect or ambiguous.
NotImplemented is only relevant at a lower level than the Expressions
chapter. Added details of comparing range() objects, and default behaviour
and consistency suggestions for user-defined classes. Patch from Andy Maier.

9 years agoMerge with 3.4
Terry Jan Reedy [Wed, 23 Sep 2015 02:59:53 +0000 (22:59 -0400)]
Merge with 3.4

9 years agoIssue #16893: Move idlelib.EditorWindow.HelpDialog deprecation warning
Terry Jan Reedy [Wed, 23 Sep 2015 02:59:40 +0000 (22:59 -0400)]
Issue #16893: Move idlelib.EditorWindow.HelpDialog deprecation warning
so it is not triggered on import.  The problem is creation of a now-unused
instance "helpDialog = HelpDialog()", left for back compatibility.
So instead trigger the warning when that instance or another is used.

9 years agoIssue #25047: Merge Element Tree encoding from 3.4 into 3.5
Martin Panter [Wed, 23 Sep 2015 01:43:08 +0000 (01:43 +0000)]
Issue #25047: Merge Element Tree encoding from 3.4 into 3.5

9 years agoIssues #25112: py.exe launcher is missing icons
Steve Dower [Wed, 23 Sep 2015 01:20:58 +0000 (18:20 -0700)]
Issues #25112: py.exe launcher is missing icons

9 years agoIssue #25047: Respect case writing XML encoding declarations
Martin Panter [Wed, 23 Sep 2015 01:14:35 +0000 (01:14 +0000)]
Issue #25047: Respect case writing XML encoding declarations

This restores the ability to write encoding names in uppercase like "UTF-8",
which worked in Python 2.

9 years agoMerge with 3.4
Terry Jan Reedy [Wed, 23 Sep 2015 01:13:39 +0000 (21:13 -0400)]
Merge with 3.4

9 years agowhitespace
Terry Jan Reedy [Wed, 23 Sep 2015 01:13:28 +0000 (21:13 -0400)]
whitespace

9 years agoMerge with 3.4
Terry Jan Reedy [Wed, 23 Sep 2015 01:10:49 +0000 (21:10 -0400)]
Merge with 3.4

9 years agoIssue #24570: Right-click for context menus now work on Mac Aqual also.
Terry Jan Reedy [Wed, 23 Sep 2015 01:10:27 +0000 (21:10 -0400)]
Issue #24570: Right-click for context menus now work on Mac Aqual also.
Patch by Mark Roseman.

9 years agoMerge from 3.4
Steve Dower [Wed, 23 Sep 2015 00:35:42 +0000 (17:35 -0700)]
Merge from 3.4

9 years agoHandle calls to win32_ver from non-Windows platform
Steve Dower [Wed, 23 Sep 2015 00:35:24 +0000 (17:35 -0700)]
Handle calls to win32_ver from non-Windows platform

9 years agoMerge from 3.4
Steve Dower [Wed, 23 Sep 2015 00:30:28 +0000 (17:30 -0700)]
Merge from 3.4

9 years agoIssue #19143: platform module now reads Windows version from kernel32.dll to avoid...
Steve Dower [Wed, 23 Sep 2015 00:29:51 +0000 (17:29 -0700)]
Issue #19143: platform module now reads Windows version from kernel32.dll to avoid compatibility shims.

9 years agoIssue #19143: platform module now reads Windows version from kernel32.dll to avoid...
Steve Dower [Wed, 23 Sep 2015 00:23:39 +0000 (17:23 -0700)]
Issue #19143: platform module now reads Windows version from kernel32.dll to avoid compatibility shims.

9 years agoIssue #25102: Windows installer does not precompile for -O or -OO.
Steve Dower [Tue, 22 Sep 2015 23:45:19 +0000 (16:45 -0700)]
Issue #25102: Windows installer does not precompile for -O or -OO.

9 years agoIssue #25081: Makes Back button in installer go back to upgrade page when upgrading.
Steve Dower [Tue, 22 Sep 2015 23:36:33 +0000 (16:36 -0700)]
Issue #25081: Makes Back button in installer go back to upgrade page when upgrading.

9 years agoIssue #25126: Clarifies that the non-web installer will download some components.
Steve Dower [Tue, 22 Sep 2015 23:36:33 +0000 (16:36 -0700)]
Issue #25126: Clarifies that the non-web installer will download some components.

9 years agoIssue #25091: Increases font size of the installer.
Steve Dower [Tue, 22 Sep 2015 23:36:29 +0000 (16:36 -0700)]
Issue #25091: Increases font size of the installer.

9 years agoCloses #25085 and #25086: Exclude distutils and test directories from embeddable...
Steve Dower [Tue, 22 Sep 2015 22:03:54 +0000 (15:03 -0700)]
Closes #25085 and #25086: Exclude distutils and test directories from embeddable distro.

9 years agoIssue #25092: Fix datetime.strftime() failure when errno was already set to EINVAL.
Steve Dower [Tue, 22 Sep 2015 21:51:42 +0000 (14:51 -0700)]
Issue #25092: Fix datetime.strftime() failure when errno was already set to EINVAL.

9 years agoIssue #25213: Restores requestedExecutionLevel to manifest to disable UAC virtualization.
Steve Dower [Tue, 22 Sep 2015 21:33:31 +0000 (14:33 -0700)]
Issue #25213: Restores requestedExecutionLevel to manifest to disable UAC virtualization.

9 years agoIssue #25137: Add a note to whatsnew/3.5.rst for nested functools.partial calls
Berker Peksag [Tue, 22 Sep 2015 10:08:16 +0000 (13:08 +0300)]
Issue #25137: Add a note to whatsnew/3.5.rst for nested functools.partial calls

Also, properly skip the test_nested_optimization test for partial subclasses
and add a test for the suggested usage.

9 years agoMerge with 3.4
Terry Jan Reedy [Tue, 22 Sep 2015 02:42:43 +0000 (22:42 -0400)]
Merge with 3.4

9 years agowhitespace
Terry Jan Reedy [Tue, 22 Sep 2015 02:42:32 +0000 (22:42 -0400)]
whitespace

9 years agoIssue #16893: Add idlelib.help.copy_strip() to copy-rstrip Doc/.../idle.html.
Terry Jan Reedy [Tue, 22 Sep 2015 02:38:47 +0000 (22:38 -0400)]
Issue #16893: Add idlelib.help.copy_strip() to copy-rstrip Doc/.../idle.html.
Change destination to help.html.  Adjust NEWS entries.

9 years agoIssue #16893: Add idlelib.help.copy_strip() to copy-rstrip Doc/.../idle.html.
Terry Jan Reedy [Tue, 22 Sep 2015 02:36:42 +0000 (22:36 -0400)]
Issue #16893: Add idlelib.help.copy_strip() to copy-rstrip Doc/.../idle.html.
Change destination to help.html.  Adjust NEWS entries.

9 years agoMarge 3.4
Terry Jan Reedy [Mon, 21 Sep 2015 23:33:14 +0000 (19:33 -0400)]
Marge 3.4

9 years agoIssue #24861: add Idle news item and correct previous errors.
Terry Jan Reedy [Mon, 21 Sep 2015 23:28:22 +0000 (19:28 -0400)]
Issue #24861: add Idle news item and correct previous errors.

9 years agoMerge 3.4 (Issue #23630, fix test_asyncio)
Victor Stinner [Mon, 21 Sep 2015 20:29:30 +0000 (22:29 +0200)]
Merge 3.4 (Issue #23630, fix test_asyncio)

9 years agoIssue #23630: Fix test_asyncio on Windows
Victor Stinner [Mon, 21 Sep 2015 20:28:44 +0000 (22:28 +0200)]
Issue #23630: Fix test_asyncio on Windows

The proactor event loop requires also to mock loop._stop_serving.

9 years agoMerge 3.4 (test_asyncio)
Victor Stinner [Mon, 21 Sep 2015 20:20:36 +0000 (22:20 +0200)]
Merge 3.4 (test_asyncio)

9 years agoIssue #25114: Fix test_asyncio
Victor Stinner [Mon, 21 Sep 2015 20:20:19 +0000 (22:20 +0200)]
Issue #25114: Fix test_asyncio

ssl.SSLContext() does not always disable compression. Fix unit test.

9 years agoMerge 3.4 (asyncio)
Victor Stinner [Mon, 21 Sep 2015 16:41:05 +0000 (18:41 +0200)]
Merge 3.4 (asyncio)

9 years agoIssue #23630, asyncio: host parameter of loop.create_server() can now be a
Victor Stinner [Mon, 21 Sep 2015 16:33:43 +0000 (18:33 +0200)]
Issue #23630, asyncio: host parameter of loop.create_server() can now be a
sequence of strings. Patch written by Yann Sionneau.

9 years agoIssue #25114: Adjust versionchanged in the doc
Victor Stinner [Mon, 21 Sep 2015 16:27:52 +0000 (18:27 +0200)]
Issue #25114: Adjust versionchanged in the doc

9 years agoMerge 3.4 (asyncio)
Victor Stinner [Mon, 21 Sep 2015 16:08:06 +0000 (18:08 +0200)]
Merge 3.4 (asyncio)

9 years agoIssue #25114, asyncio: add ssl_object extra info to SSL transports
Victor Stinner [Mon, 21 Sep 2015 16:06:17 +0000 (18:06 +0200)]
Issue #25114, asyncio: add ssl_object extra info to SSL transports

This info is required on Python 3.5 and newer to get specific information on
the SSL object, like getting the binary peer certificate (instead of getting
it as text).

9 years agoIssue #25122: test_eintr: the FreeBSD fix will be released in FreeBSD 10.3
Victor Stinner [Mon, 21 Sep 2015 12:05:02 +0000 (14:05 +0200)]
Issue #25122: test_eintr: the FreeBSD fix will be released in FreeBSD 10.3

9 years agoMerge 3.4 (test_socket, issue #25138)
Victor Stinner [Mon, 21 Sep 2015 07:04:17 +0000 (09:04 +0200)]
Merge 3.4 (test_socket, issue #25138)

9 years agoIssue #25138: test_socket.test_idna() uses support.transient_internet() instead
Victor Stinner [Mon, 21 Sep 2015 07:04:01 +0000 (09:04 +0200)]
Issue #25138: test_socket.test_idna() uses support.transient_internet() instead
of catching socket.EAI_NODATA error which doesn't exist on FreeBSD.

9 years agoMerge with 3.4
Terry Jan Reedy [Mon, 21 Sep 2015 05:44:20 +0000 (01:44 -0400)]
Merge with 3.4

9 years agoIssue #24861: Add docstring to idlelib.__init__ with 'private' warning.
Terry Jan Reedy [Mon, 21 Sep 2015 05:44:06 +0000 (01:44 -0400)]
Issue #24861: Add docstring to idlelib.__init__ with 'private' warning.

9 years agoMove items from NEWS to idlelib/NEWS.txt. Standardize headers spacing: 2 lines
Terry Jan Reedy [Mon, 21 Sep 2015 05:10:21 +0000 (01:10 -0400)]
Move items from NEWS to idlelib/NEWS.txt.  Standardize headers spacing: 2 lines
above "What's New and 0 lines above "Release date".  Remove most old headers
for non-final releases (they currently do not get carried forward.

9 years agoMove items from NEWS to idlelib/NEWS.txt. Standardize headers spacing: 2 lines
Terry Jan Reedy [Mon, 21 Sep 2015 05:07:59 +0000 (01:07 -0400)]
Move items from NEWS to idlelib/NEWS.txt.  Standardize headers spacing: 2 lines
above "What's New and 0 lines above "Release date".  Remove most old headers
for non-final releases (they currently do not get carried forward.

9 years agoIssue #23484: Document differences between synchronization primitives of
Berker Peksag [Mon, 21 Sep 2015 03:51:45 +0000 (06:51 +0300)]
Issue #23484: Document differences between synchronization primitives of
threading and multiprocessing modules.

In multiprocessing, the name of the first parameter of the acquire methods is
"block", but "blocking" in threading.

This commit also improves documentation of Lock and RLock.

Patch by Davin Potts.

9 years agoIssue #23484: Document differences between synchronization primitives of
Berker Peksag [Mon, 21 Sep 2015 03:50:55 +0000 (06:50 +0300)]
Issue #23484: Document differences between synchronization primitives of
threading and multiprocessing modules.

In multiprocessing, the name of the first parameter of the acquire methods is
"block", but "blocking" in threading.

This commit also improves documentation of Lock and RLock.

Patch by Davin Potts.

9 years agoAdd NEWS items for Idle.
Terry Jan Reedy [Mon, 21 Sep 2015 03:23:44 +0000 (23:23 -0400)]
Add NEWS items for Idle.

9 years agoAdd NEWS items for Idle.
Terry Jan Reedy [Mon, 21 Sep 2015 03:21:22 +0000 (23:21 -0400)]
Add NEWS items for Idle.

9 years agoIssue #25169: os.getppid() is available on Windows since Python 3.2.
Berker Peksag [Mon, 21 Sep 2015 03:13:14 +0000 (06:13 +0300)]
Issue #25169: os.getppid() is available on Windows since Python 3.2.

Patch by Bar Harel.

9 years agoIssue #25169: os.getppid() is available on Windows since Python 3.2.
Berker Peksag [Mon, 21 Sep 2015 03:12:50 +0000 (06:12 +0300)]
Issue #25169: os.getppid() is available on Windows since Python 3.2.

Patch by Bar Harel.

9 years agoMerge with 3.4
Terry Jan Reedy [Mon, 21 Sep 2015 03:05:41 +0000 (23:05 -0400)]
Merge with 3.4

9 years agoIssue #16893: finish deprecation.
Terry Jan Reedy [Mon, 21 Sep 2015 03:05:25 +0000 (23:05 -0400)]
Issue #16893: finish deprecation.

9 years agoMerge with 3.4
Terry Jan Reedy [Mon, 21 Sep 2015 02:55:51 +0000 (22:55 -0400)]
Merge with 3.4

9 years agoIssue #25199: Idle: add synchronization comments for future maintainers.
Terry Jan Reedy [Mon, 21 Sep 2015 02:55:39 +0000 (22:55 -0400)]
Issue #25199: Idle: add synchronization comments for future maintainers.

9 years agoMerge with 3.4
Terry Jan Reedy [Mon, 21 Sep 2015 00:03:22 +0000 (20:03 -0400)]
Merge with 3.4

9 years agoIssue #16893: whitespace in idle.html.
Terry Jan Reedy [Mon, 21 Sep 2015 00:03:01 +0000 (20:03 -0400)]
Issue #16893: whitespace in idle.html.

9 years agoMerge with 3.4
Terry Jan Reedy [Sun, 20 Sep 2015 23:57:37 +0000 (19:57 -0400)]
Merge with 3.4

9 years agoIssue #16893: Replace help.txt with idle.html for Idle doc display.
Terry Jan Reedy [Sun, 20 Sep 2015 23:57:13 +0000 (19:57 -0400)]
Issue #16893: Replace help.txt with idle.html for Idle doc display.
The new idlelib/idle.html is copied from Doc/build/html/idle.html.
It looks better than help.txt and will better document Idle as released.
The tkinter html viewer that works for this file was written by Rose Roseman.
The new code is in idlelib/help.py, a new file for help menu classes.
The now unused EditorWindow.HelpDialog class and helt.txt file are deprecated.

9 years agomerge 3.4 (#25145)
Benjamin Peterson [Sun, 20 Sep 2015 18:18:51 +0000 (23:18 +0500)]
merge 3.4 (#25145)

9 years agoremove reference to PyGoogle (#25145)
Benjamin Peterson [Sun, 20 Sep 2015 18:17:41 +0000 (23:17 +0500)]
remove reference to PyGoogle (#25145)

Patch by Bar Harel.

9 years agouse a more modern UA (#25145)
Benjamin Peterson [Sun, 20 Sep 2015 18:16:45 +0000 (23:16 +0500)]
use a more modern UA (#25145)

9 years agoMerge with 3.4
Terry Jan Reedy [Sun, 20 Sep 2015 06:34:20 +0000 (02:34 -0400)]
Merge with 3.4

9 years agoIssue #24199: Add stacklevel to deprecation warning call.
Terry Jan Reedy [Sun, 20 Sep 2015 06:34:03 +0000 (02:34 -0400)]
Issue #24199: Add stacklevel to deprecation warning call.

9 years agoIssue #25176: Merge cgi.parse_qsl link from 3.4 into 3.5
Martin Panter [Sun, 20 Sep 2015 01:07:41 +0000 (01:07 +0000)]
Issue #25176: Merge cgi.parse_qsl link from 3.4 into 3.5

9 years agoIssue #25176: Correct link for cgi.parse_qsl; patch from Ville Skyttä
Martin Panter [Sun, 20 Sep 2015 00:28:50 +0000 (00:28 +0000)]
Issue #25176: Correct link for cgi.parse_qsl; patch from Ville Skyttä

9 years agoIssue #24999: In longobject.c, use two shifts instead of ">> 2*PyLong_SHIFT" to
Victor Stinner [Sat, 19 Sep 2015 11:39:03 +0000 (13:39 +0200)]
Issue #24999: In longobject.c, use two shifts instead of ">> 2*PyLong_SHIFT" to
avoid undefined behaviour when LONG_MAX type is smaller than 60 bits.

This change should fix a warning with the ICC compiler.

9 years agoIssue #25101: Try to create a file to test write access in test_zipfile.
Serhiy Storchaka [Sat, 19 Sep 2015 07:59:48 +0000 (10:59 +0300)]
Issue #25101: Try to create a file to test write access in test_zipfile.

9 years agoIssue #25101: Try to create a file to test write access in test_zipfile.
Serhiy Storchaka [Sat, 19 Sep 2015 07:55:20 +0000 (10:55 +0300)]
Issue #25101: Try to create a file to test write access in test_zipfile.

9 years agoMake it clearer that the constants in the selectors docs are module-level
Brett Cannon [Fri, 18 Sep 2015 22:21:02 +0000 (15:21 -0700)]
Make it clearer that the constants in the selectors docs are module-level

9 years agoIssue #24915: Add Clang support to PGO builds and use the test suite
Brett Cannon [Fri, 18 Sep 2015 22:13:44 +0000 (15:13 -0700)]
Issue #24915: Add Clang support to PGO builds and use the test suite
for profile data.

Thanks to Alecsandru Patrascu of Intel for the initial patch.

9 years agoMerge 3.4 (test_email)
Victor Stinner [Fri, 18 Sep 2015 14:32:51 +0000 (16:32 +0200)]
Merge 3.4 (test_email)

9 years agoIssue #24836: Skip FormatDateTests of test_email.test_utils on Mac OS X Snow
Victor Stinner [Fri, 18 Sep 2015 14:32:23 +0000 (16:32 +0200)]
Issue #24836: Skip FormatDateTests of test_email.test_utils on Mac OS X Snow
Leopard because this OS uses out of date (pre 2011k) timezone files.

9 years agoIssue #25150: Hide the private _Py_atomic_xxx symbols from the public
Victor Stinner [Fri, 18 Sep 2015 13:06:34 +0000 (15:06 +0200)]
Issue #25150: Hide the private _Py_atomic_xxx symbols from the public
Python.h header to fix a compilation error with OpenMP. PyThreadState_GET()
becomes an alias to PyThreadState_Get() to avoid ABI incompatibilies.

It is important that the _PyThreadState_Current variable is always accessed
with the same implementation of pyatomic.h. Use the PyThreadState_Get()
function so extension modules will all reuse the same implementation.

9 years agoMerge 3.4 (datetime rounding)
Victor Stinner [Fri, 18 Sep 2015 12:50:18 +0000 (14:50 +0200)]
Merge 3.4 (datetime rounding)

9 years agoIssue #23517: Fix rounding in fromtimestamp() and utcfromtimestamp() methods
Victor Stinner [Fri, 18 Sep 2015 12:42:05 +0000 (14:42 +0200)]
Issue #23517: Fix rounding in fromtimestamp() and utcfromtimestamp() methods
of datetime.datetime: microseconds are now rounded to nearest with ties going
to nearest even integer (ROUND_HALF_EVEN), instead of being rounding towards
zero (ROUND_DOWN). It's important that these methods use the same rounding
mode than datetime.timedelta to keep the property:

   (datetime(1970,1,1) + timedelta(seconds=t)) == datetime.utcfromtimestamp(t)

It also the rounding mode used by round(float) for example.

Add more unit tests on the rounding mode in test_datetime.

9 years agoIssue #25155: Fix _PyTime_Divide() rounding
Victor Stinner [Fri, 18 Sep 2015 12:21:14 +0000 (14:21 +0200)]
Issue #25155: Fix _PyTime_Divide() rounding

_PyTime_Divide() rounding was wrong: copy code from Python default which has
now much better unit tests.

9 years agoIssue #25155: document the bugfix in Misc/NEWS
Victor Stinner [Fri, 18 Sep 2015 11:59:09 +0000 (13:59 +0200)]
Issue #25155: document the bugfix in Misc/NEWS

Oops, I forgot to document my change.

9 years agoodictobject.c: fix compiler warning
Victor Stinner [Fri, 18 Sep 2015 11:44:11 +0000 (13:44 +0200)]
odictobject.c: fix compiler warning

PyObject_Length() returns a P_ssize_t, not an int. Use a Py_ssize_t to avoid
overflow.

9 years agoIssue #25155: Add _PyTime_AsTimevalTime_t() function
Victor Stinner [Fri, 18 Sep 2015 11:36:17 +0000 (13:36 +0200)]
Issue #25155: Add _PyTime_AsTimevalTime_t() function

On Windows, the tv_sec field of the timeval structure has the type C long,
whereas it has the type C time_t on all other platforms. A C long has a size of
32 bits (signed inter, 1 bit for the sign, 31 bits for the value) which is not
enough to store an Epoch timestamp after the year 2038.

Add the _PyTime_AsTimevalTime_t() function written for datetime.datetime.now():
convert a _PyTime_t timestamp to a (secs, us) tuple where secs type is time_t.
It allows to support dates after the year 2038 on Windows.

Enhance also _PyTime_AsTimeval_impl() to detect overflow on the number of
seconds when rounding the number of microseconds.