]> granicus.if.org Git - python/log
python
9 years agoIssue #23485: Enhance and update selectors doc and test_selectors
Victor Stinner [Tue, 31 Mar 2015 10:08:09 +0000 (12:08 +0200)]
Issue #23485: Enhance and update selectors doc and test_selectors

Selector.select() is now retried with the recomputed timeout when interrupted
by a signal.

Write an unit test with a signal handler raising an exception, and a unit with
a signal handler which does not raise an exception (it does nothing).

9 years agoIssue #23485: select.devpoll.poll() is now retried when interrupted by a signal
Victor Stinner [Tue, 31 Mar 2015 10:10:33 +0000 (12:10 +0200)]
Issue #23485: select.devpoll.poll() is now retried when interrupted by a signal

9 years agoIssue #23485: select.kqueue.control() is now retried when interrupted by a signal
Victor Stinner [Tue, 31 Mar 2015 09:48:34 +0000 (11:48 +0200)]
Issue #23485: select.kqueue.control() is now retried when interrupted by a signal

9 years agoFix typo in Doc/whatsnew/3.5.rst.
Berker Peksag [Tue, 31 Mar 2015 04:20:03 +0000 (07:20 +0300)]
Fix typo in Doc/whatsnew/3.5.rst.

9 years agomerge
Raymond Hettinger [Tue, 31 Mar 2015 03:29:55 +0000 (20:29 -0700)]
merge

9 years agoIssue #23729: Improve docs for ElementTree namespace parsing
Raymond Hettinger [Tue, 31 Mar 2015 03:29:28 +0000 (20:29 -0700)]
Issue #23729:  Improve docs for ElementTree namespace parsing

9 years agoIssue #23485: select.epoll.poll() is now retried when interrupted by a signal
Victor Stinner [Mon, 30 Mar 2015 19:59:21 +0000 (21:59 +0200)]
Issue #23485: select.epoll.poll() is now retried when interrupted by a signal

9 years agoIssue #23485: select.poll.poll() is now retried when interrupted by a signal
Victor Stinner [Mon, 30 Mar 2015 19:38:00 +0000 (21:38 +0200)]
Issue #23485: select.poll.poll() is now retried when interrupted by a signal

9 years agoIssue #23485: Add _PyTime_FromMillisecondsObject() function
Victor Stinner [Mon, 30 Mar 2015 19:36:10 +0000 (21:36 +0200)]
Issue #23485: Add _PyTime_FromMillisecondsObject() function

9 years agoIssue #23485: Fix test_signal, select.select() now retries the syscall if the
Victor Stinner [Mon, 30 Mar 2015 20:09:14 +0000 (22:09 +0200)]
Issue #23485: Fix test_signal, select.select() now retries the syscall if the
signal handler does not raise an exception

9 years agoIgnore .rst files in the venv directory.
Brett Cannon [Mon, 30 Mar 2015 19:35:37 +0000 (15:35 -0400)]
Ignore .rst files in the venv directory.

9 years agoPEP 475: on EINTR, retry the function even if the timeout is equals to zero
Victor Stinner [Mon, 30 Mar 2015 19:33:51 +0000 (21:33 +0200)]
PEP 475: on EINTR, retry the function even if the timeout is equals to zero

Retry:

* signal.sigtimedwait()
* threading.Lock.acquire()
* threading.RLock.acquire()
* time.sleep()

9 years agoIssue #23485: select.select() is now retried automatically with the recomputed
Victor Stinner [Mon, 30 Mar 2015 19:16:11 +0000 (21:16 +0200)]
Issue #23485: select.select() is now retried automatically with the recomputed
timeout when interrupted by a signal, except if the signal handler raises an
exception. This change is part of the PEP 475.

The asyncore and selectors module doesn't catch the InterruptedError exception
anymore when calling select.select(), since this function should not raise
InterruptedError anymore.

9 years agoPartially revert 3603bae63c13 (issue23326) for asyncio.
Serhiy Storchaka [Mon, 30 Mar 2015 19:25:16 +0000 (22:25 +0300)]
Partially revert 3603bae63c13 (issue23326) for asyncio.

9 years ago#2211: Fix typo, address missed review comment.
R David Murray [Mon, 30 Mar 2015 15:48:50 +0000 (11:48 -0400)]
#2211: Fix typo, address missed review comment.

9 years agoMerge: #23792: also catch interrupt around pipe.write.
R David Murray [Mon, 30 Mar 2015 14:15:22 +0000 (10:15 -0400)]
Merge: #23792: also catch interrupt around pipe.write.

9 years ago#23792: also catch interrupt around pipe.write.
R David Murray [Mon, 30 Mar 2015 14:14:47 +0000 (10:14 -0400)]
#23792: also catch interrupt around pipe.write.

The previous patch only dealt with KeyboardInterrupt when all of the
data had been consumed by the pager.  This deals with the interrupt
when some data is still pending.

9 years agoWhat's New in Python 3.5: add pep 461 (bytes%args) and 465 (a@b)
Victor Stinner [Mon, 30 Mar 2015 13:04:45 +0000 (15:04 +0200)]
What's New in Python 3.5: add pep 461 (bytes%args) and 465 (a@b)

9 years agoIssue #23605: Fix typo in an os.walk() comment
Victor Stinner [Mon, 30 Mar 2015 09:54:05 +0000 (11:54 +0200)]
Issue #23605: Fix typo in an os.walk() comment

Thanks Ben Hoyt for the report.

9 years ago(Merge 3.4) Issue #22585: os.urandom() now releases the GIL when the
Victor Stinner [Mon, 30 Mar 2015 09:19:07 +0000 (11:19 +0200)]
(Merge 3.4) Issue #22585: os.urandom() now releases the GIL when the
getentropy() is used (OpenBSD 5.6+).

9 years agoIssue #22585: os.urandom() now releases the GIL when the getentropy() is used
Victor Stinner [Mon, 30 Mar 2015 09:18:30 +0000 (11:18 +0200)]
Issue #22585: os.urandom() now releases the GIL when the getentropy() is used
(OpenBSD 5.6+).

9 years agoIssue #22181: os.urandom() now releases the GIL when the getrandom()
Victor Stinner [Mon, 30 Mar 2015 09:16:40 +0000 (11:16 +0200)]
Issue #22181: os.urandom() now releases the GIL when the getrandom()
implementation is used.

9 years agoFix PY_VERSION in Include/patchlevel.h to reflect our post-3.5.0a3 state.
Larry Hastings [Mon, 30 Mar 2015 08:56:27 +0000 (01:56 -0700)]
Fix PY_VERSION in Include/patchlevel.h to reflect our post-3.5.0a3 state.

9 years agoMerge 3.5.0a3 release engineering changes back into trunk.
Larry Hastings [Mon, 30 Mar 2015 08:50:00 +0000 (01:50 -0700)]
Merge 3.5.0a3 release engineering changes back into trunk.

9 years agoIssue #22117: Try to fix rounding in conversion from Python double to _PyTime_t
Victor Stinner [Mon, 30 Mar 2015 08:22:16 +0000 (10:22 +0200)]
Issue #22117: Try to fix rounding in conversion from Python double to _PyTime_t
using the C volatile keyword.

9 years agoIssue #23752: _Py_fstat() is now responsible to raise the Python exception
Victor Stinner [Mon, 30 Mar 2015 08:09:31 +0000 (10:09 +0200)]
Issue #23752: _Py_fstat() is now responsible to raise the Python exception

Add _Py_fstat_noraise() function when a Python exception is not welcome.

9 years agoIssue #23785: Fixed memory leak in TextIOWrapper.tell() in rare circumstances.
Serhiy Storchaka [Mon, 30 Mar 2015 07:00:40 +0000 (10:00 +0300)]
Issue #23785: Fixed memory leak in TextIOWrapper.tell() in rare circumstances.

9 years agoIssue #23785: Fixed memory leak in TextIOWrapper.tell() in rare circumstances.
Serhiy Storchaka [Mon, 30 Mar 2015 06:58:41 +0000 (09:58 +0300)]
Issue #23785: Fixed memory leak in TextIOWrapper.tell() in rare circumstances.

9 years agoIssue #23783: Fixed memory leak in PyObject_ClearWeakRefs() in case of
Serhiy Storchaka [Mon, 30 Mar 2015 06:52:53 +0000 (09:52 +0300)]
Issue #23783: Fixed memory leak in PyObject_ClearWeakRefs() in case of
MemoryError.

9 years agoIssue #23783: Fixed memory leak in PyObject_ClearWeakRefs() in case of
Serhiy Storchaka [Mon, 30 Mar 2015 06:52:29 +0000 (09:52 +0300)]
Issue #23783: Fixed memory leak in PyObject_ClearWeakRefs() in case of
MemoryError.

9 years agoIssue #23466: %c, %o, %x, and %X in bytes formatting now raise TypeError on
Serhiy Storchaka [Mon, 30 Mar 2015 06:19:08 +0000 (09:19 +0300)]
Issue #23466: %c, %o, %x, and %X in bytes formatting now raise TypeError on
non-integer input.

9 years agoIssue #23171: csv.Writer.writerow() now supports arbitrary iterables.
Serhiy Storchaka [Mon, 30 Mar 2015 06:09:54 +0000 (09:09 +0300)]
Issue #23171: csv.Writer.writerow() now supports arbitrary iterables.

9 years agoIssue #22117: Remove _PyTime_ROUND_DOWN and _PyTime_ROUND_UP rounding methods
Victor Stinner [Mon, 30 Mar 2015 01:57:14 +0000 (03:57 +0200)]
Issue #22117: Remove _PyTime_ROUND_DOWN and _PyTime_ROUND_UP rounding methods

Use _PyTime_ROUND_FLOOR and _PyTime_ROUND_CEILING instead.

9 years ago#23745: handle duplicate MIME parameter names in new parser.
R David Murray [Mon, 30 Mar 2015 01:53:05 +0000 (21:53 -0400)]
#23745: handle duplicate MIME parameter names in new parser.

This mimics get_param's error handling for the most part.  It is slightly
better in some regards as get_param can produce some really weird results for
duplicate *0* parts.  It departs from get_param slightly in that if we have a
mix of non-extended and extended pieces for the same parameter name, the new
parser assumes they were all supposed to be extended and concatenates all the
values, whereas get_param always picks the non-extended parameter value.  All
of this error recovery is pretty much arbitrary decisions...

9 years agoIssue #22117: Replace usage of _PyTime_ROUND_UP with _PyTime_ROUND_CEILING
Victor Stinner [Mon, 30 Mar 2015 01:49:14 +0000 (03:49 +0200)]
Issue #22117: Replace usage of _PyTime_ROUND_UP with _PyTime_ROUND_CEILING

All these functions only accept positive timeouts, so this change has no effect
in practice.

9 years agoIssue #22117: Add _PyTime_ROUND_CEILING rounding method for timestamps
Victor Stinner [Mon, 30 Mar 2015 01:52:49 +0000 (03:52 +0200)]
Issue #22117: Add _PyTime_ROUND_CEILING rounding method for timestamps

Add also more tests for ROUNd_FLOOR.

9 years agoMerge: #23745: handle duplicate MIME parameter names in new parser.
R David Murray [Mon, 30 Mar 2015 01:54:27 +0000 (21:54 -0400)]
Merge: #23745: handle duplicate MIME parameter names in new parser.

9 years agoIssue #23752: When built from an existing file descriptor, io.FileIO() now only
Victor Stinner [Mon, 30 Mar 2015 01:21:06 +0000 (03:21 +0200)]
Issue #23752: When built from an existing file descriptor, io.FileIO() now only
calls fstat() once. Before fstat() was called twice, which was not necessary.

9 years agoIssue #22117: Add assertions to _PyTime_AsTimeval() and _PyTime_AsTimespec() to
Victor Stinner [Mon, 30 Mar 2015 00:54:57 +0000 (02:54 +0200)]
Issue #22117: Add assertions to _PyTime_AsTimeval() and _PyTime_AsTimespec() to
check that microseconds and nanoseconds fits into the specified range.

9 years agoIssue #22117: Fix usage of _PyTime_AsTimeval()
Victor Stinner [Mon, 30 Mar 2015 00:51:13 +0000 (02:51 +0200)]
Issue #22117: Fix usage of _PyTime_AsTimeval()

Add _PyTime_AsTimeval_noraise() function. Call it when it's not possible (or
not useful) to raise a Python exception on overflow.

9 years agoIssue #23694: Fix usage of _Py_open() in the _posixsubprocess module
Victor Stinner [Mon, 30 Mar 2015 00:18:31 +0000 (02:18 +0200)]
Issue #23694: Fix usage of _Py_open() in the _posixsubprocess module

Don't call _Py_open() from _close_open_fds_safe() because it is call just after
fork(). It's not good to play with locks (the GIL) between fork() and exec().

Use instead _Py_open_noraise() which doesn't touch to the GIL.

9 years agoIssue #22117: Fix rounding of fromtimestamp() methods of datetime.datetime and
Victor Stinner [Sun, 29 Mar 2015 23:10:14 +0000 (01:10 +0200)]
Issue #22117: Fix rounding of fromtimestamp() methods of datetime.datetime and
datetime.time: round towards minus infinity ("floor") instead of rounding
towards zero ("down").

9 years agoIssue #22117: Fix os.utime(), it now rounds the timestamp towards minus
Victor Stinner [Sun, 29 Mar 2015 23:02:57 +0000 (01:02 +0200)]
Issue #22117: Fix os.utime(), it now rounds the timestamp towards minus
infinity (-inf) instead of rounding towards zero.

Replace _PyTime_ROUND_DOWN with _PyTime_ROUND_FLOOR.

9 years agoIssue #22117: Fix rounding and implement _PyTime_ROUND_FLOOR in:
Victor Stinner [Sun, 29 Mar 2015 22:44:06 +0000 (00:44 +0200)]
Issue #22117: Fix rounding and implement _PyTime_ROUND_FLOOR in:

- _PyTime_ObjectToTime_t()
- _PyTime_ObjectToTimespec()
- _PyTime_ObjectToTimeval()

9 years agoAdded tag v3.5.0a3 for changeset 82656e28b5e5
Larry Hastings [Sun, 29 Mar 2015 22:34:44 +0000 (15:34 -0700)]
Added tag v3.5.0a3 for changeset 82656e28b5e5

9 years agoRelease bump for Python 3.5.0a3. v3.5.0a3
Larry Hastings [Sun, 29 Mar 2015 22:34:26 +0000 (15:34 -0700)]
Release bump for Python 3.5.0a3.

9 years agoRegenerated pydoc topics and minor doc fixes for 3.5.0a3.
Larry Hastings [Sun, 29 Mar 2015 22:32:55 +0000 (15:32 -0700)]
Regenerated pydoc topics and minor doc fixes for 3.5.0a3.

9 years agoIssue #22390: test.regrtest now emits a warning if temporary files or
Serhiy Storchaka [Sun, 29 Mar 2015 22:28:02 +0000 (01:28 +0300)]
Issue #22390: test.regrtest now emits a warning if temporary files or
directories are left after running a test.

9 years agoIssue #22117: Cleanup pytime.c/.h
Victor Stinner [Sun, 29 Mar 2015 22:25:38 +0000 (00:25 +0200)]
Issue #22117: Cleanup pytime.c/.h

9 years agoIssue #22117: Use the _PyTime_t API in _datetime.datetime() constructor
Victor Stinner [Sun, 29 Mar 2015 22:09:18 +0000 (00:09 +0200)]
Issue #22117: Use the _PyTime_t API in _datetime.datetime() constructor

* Remove _PyTime_gettimeofday()
* Add _PyTime_GetSystemClock()

9 years agoIssue #22390: test.regrtest now emits a warning if temporary files or
Serhiy Storchaka [Sun, 29 Mar 2015 22:30:22 +0000 (01:30 +0300)]
Issue #22390: test.regrtest now emits a warning if temporary files or
directories are left after running a test.

9 years agoIssue #14260: The groupindex attribute of regular expression pattern object
Serhiy Storchaka [Sun, 29 Mar 2015 22:01:48 +0000 (01:01 +0300)]
Issue #14260: The groupindex attribute of regular expression pattern object
now is non-modifiable mapping.

9 years ago#2211: properly document the Morsel behavior changes.
R David Murray [Sun, 29 Mar 2015 21:09:21 +0000 (17:09 -0400)]
#2211: properly document the Morsel behavior changes.

Also deprecate the undocumented set argument instead of removing
it already in 3.5.

Initial patch by Demian Brecht.

9 years agomerge 3.4 (#23801)
Benjamin Peterson [Sun, 29 Mar 2015 20:45:19 +0000 (16:45 -0400)]
merge 3.4 (#23801)

9 years agoCloses #23801 - Ignore entire preamble to multipart in cgi.FieldStorage
Donald Stufft [Sun, 29 Mar 2015 20:43:23 +0000 (16:43 -0400)]
Closes #23801 - Ignore entire preamble to multipart in cgi.FieldStorage

9 years agoMerge: #23792: Ignore KeyboardInterrupt when the pydoc pager is active.
R David Murray [Sun, 29 Mar 2015 19:19:13 +0000 (15:19 -0400)]
Merge: #23792: Ignore KeyboardInterrupt when the pydoc pager is active.

9 years ago#23792: Ignore KeyboardInterrupt when the pydoc pager is active.
R David Murray [Sun, 29 Mar 2015 19:15:40 +0000 (15:15 -0400)]
#23792: Ignore KeyboardInterrupt when the pydoc pager is active.

Previously, if you hit ctl-c while the pager was active, the python that
launched the subprocess for the pager would see the KeyboardInterrupt in the
__exit__ method of the subprocess context manager where it was waiting for the
subprocess to complete, ending the wait.  This would leave the pager running,
while the interactive interpreter, after handling the exception by printing
it, would go back to trying to post a prompt...but the pager would generally
have the terminal in raw mode, and in any case would be still trying to read
from stdin.  On some systems, even exiting python at that point would not
restore the terminal mode.  The problem with raw mode could also happen if
ctl-C was hit when pydoc was called from the shell command line and the pager
was active.

Instead, we now wait on the subprocess in a loop, ignoring KeyboardInterrupt
just like the pager does, until the pager actually exits.

(Note: this was a regression relative to python2...in python2 the pager
is called via system, and system does not return until the pager exits.)

9 years agoAdded explicit tests for issue #23803.
Serhiy Storchaka [Sun, 29 Mar 2015 16:23:27 +0000 (19:23 +0300)]
Added explicit tests for issue #23803.

9 years agoIssue #23803: Fixed str.partition() and str.rpartition() when a separator
Serhiy Storchaka [Sun, 29 Mar 2015 16:21:02 +0000 (19:21 +0300)]
Issue #23803: Fixed str.partition() and str.rpartition() when a separator
is wider then partitioned string.

9 years agoRemoved unintentional trailing spaces in text files.
Serhiy Storchaka [Sun, 29 Mar 2015 16:12:58 +0000 (19:12 +0300)]
Removed unintentional trailing spaces in text files.

9 years agoMake some tests more frienly to MemoryError.
Serhiy Storchaka [Sat, 28 Mar 2015 18:39:51 +0000 (20:39 +0200)]
Make some tests more frienly to MemoryError.
Free memory, unlock hanging threads.

9 years agoMake some tests more frienly to MemoryError.
Serhiy Storchaka [Sat, 28 Mar 2015 18:38:37 +0000 (20:38 +0200)]
Make some tests more frienly to MemoryError.
Free memory, unlock hanging threads.

9 years agoIssue #22117: Fix _PyTime_GetMonotonicClock() and
Victor Stinner [Sat, 28 Mar 2015 04:24:19 +0000 (05:24 +0100)]
Issue #22117: Fix _PyTime_GetMonotonicClock() and
_PyTime_GetSystemClockWithInfo() to not raise an exception and return 0 on
error (it should never occur)

9 years agoIssue #22117: Add the new _PyTime_ROUND_FLOOR rounding method for the datetime
Victor Stinner [Sat, 28 Mar 2015 04:02:39 +0000 (05:02 +0100)]
Issue #22117: Add the new _PyTime_ROUND_FLOOR rounding method for the datetime
module. time.clock_settime() now uses this rounding method instead of
_PyTime_ROUND_DOWN to handle correctly dates before 1970.

9 years agoIssue #22117: Use the _PyTime_t API for time.clock_settime()
Victor Stinner [Sat, 28 Mar 2015 03:09:41 +0000 (04:09 +0100)]
Issue #22117: Use the _PyTime_t API for time.clock_settime()

Remove also the now unused _PyTime_AddDouble() function.

9 years agoIssue #22117: Use the new _PyTime_t API in the select module
Victor Stinner [Sat, 28 Mar 2015 04:07:51 +0000 (05:07 +0100)]
Issue #22117: Use the new _PyTime_t API in the select module

9 years agoIssue #22117: The thread module uses the new _PyTime_t timestamp API
Victor Stinner [Sat, 28 Mar 2015 02:52:05 +0000 (03:52 +0100)]
Issue #22117: The thread module uses the new _PyTime_t timestamp API

Add also a new _PyTime_AsMicroseconds() function.

threading.TIMEOUT_MAX is now be smaller: only 292 years instead of 292,271
years on 64-bit system for example. Sorry, your threads will hang a *little
bit* shorter. Call me if you want to ensure that your locks wait longer, I can
share some tricks with you.

9 years agoIssue #22117: Fix ssl to use _PyTime_t API on sock_timeout
Victor Stinner [Sat, 28 Mar 2015 02:00:46 +0000 (03:00 +0100)]
Issue #22117: Fix ssl to use _PyTime_t API on sock_timeout

I didn't notice that the ssl module uses private attributes of socket objects.

9 years agoIssue #22117: remove _PyTime_INTERVAL() macro
Victor Stinner [Sat, 28 Mar 2015 00:32:13 +0000 (01:32 +0100)]
Issue #22117: remove _PyTime_INTERVAL() macro

9 years agoIssue #22117: The socket module uses _PyTime_t timestamp for timeouts
Victor Stinner [Sat, 28 Mar 2015 00:18:54 +0000 (01:18 +0100)]
Issue #22117: The socket module uses _PyTime_t timestamp for timeouts

9 years agoIssue #22117: Write unit tests for _PyTime_AsTimeval()
Victor Stinner [Sat, 28 Mar 2015 00:26:47 +0000 (01:26 +0100)]
Issue #22117: Write unit tests for _PyTime_AsTimeval()

* _PyTime_AsTimeval() now ensures that tv_usec is always positive
* _PyTime_AsTimespec() now ensures that tv_nsec is always positive
* _PyTime_AsTimeval() now returns an integer on overflow instead of raising an
  exception

9 years agoIssue #23618, #22117: refactor socketmodule.c
Victor Stinner [Fri, 27 Mar 2015 21:59:32 +0000 (22:59 +0100)]
Issue #23618, #22117: refactor socketmodule.c

Move Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS inside internal_select_ex() to
prepare a switch to the _PyTime_t type and retry syscall on EINTR.

9 years agoIssue #22117: The signal modules uses the new _PyTime_t API
Victor Stinner [Fri, 27 Mar 2015 17:19:03 +0000 (18:19 +0100)]
Issue #22117: The signal modules uses the new _PyTime_t API

* Add _PyTime_AsTimespec()
* Add unit tests for _PyTime_AsTimespec()

9 years agoIssue #22117: The gc module now uses _PyTime_t timestamp
Victor Stinner [Fri, 27 Mar 2015 16:47:53 +0000 (17:47 +0100)]
Issue #22117: The gc module now uses _PyTime_t timestamp

9 years agoIssue #22117: time.time() now uses the new _PyTime_t API
Victor Stinner [Fri, 27 Mar 2015 17:16:17 +0000 (18:16 +0100)]
Issue #22117: time.time() now uses the new _PyTime_t API

* Add _PyTime_GetSystemClockWithInfo()

9 years agoIssue #22117: time.monotonic() now uses the new _PyTime_t API
Victor Stinner [Fri, 27 Mar 2015 21:27:24 +0000 (22:27 +0100)]
Issue #22117: time.monotonic() now uses the new _PyTime_t API

* Add _PyTime_FromNanoseconds()
* Add _PyTime_AsSecondsDouble()
* Add unit tests for _PyTime_AsSecondsDouble()

9 years agoformat .. note properly
Benjamin Peterson [Fri, 27 Mar 2015 20:07:35 +0000 (16:07 -0400)]
format .. note properly

9 years agoRemove a dead test for a never-launched API
Brett Cannon [Fri, 27 Mar 2015 18:21:26 +0000 (14:21 -0400)]
Remove a dead test for a never-launched API

9 years agoMerge
Brett Cannon [Fri, 27 Mar 2015 16:57:16 +0000 (12:57 -0400)]
Merge

9 years agoFix module deprecation warnings to have a useful stacklevel
Brett Cannon [Fri, 27 Mar 2015 16:56:57 +0000 (12:56 -0400)]
Fix module deprecation warnings to have a useful stacklevel

9 years agoIssue #22117: Fix rounding in _PyTime_FromSecondsObject()
Victor Stinner [Fri, 27 Mar 2015 16:12:45 +0000 (17:12 +0100)]
Issue #22117: Fix rounding in _PyTime_FromSecondsObject()

* Rename _PyTime_FromObject() to _PyTime_FromSecondsObject()
* Add _PyTime_AsNanosecondsObject() and _testcapi.pytime_fromsecondsobject()
* Add unit tests

9 years agoIssue #22117: Fix test_gdb for the new time.sleep()
Victor Stinner [Fri, 27 Mar 2015 14:42:37 +0000 (15:42 +0100)]
Issue #22117: Fix test_gdb for the new time.sleep()

Use time.gmtime() instead of time.sleep(), because time.sleep() is no more
declared with METH_VARARGS but with METH_O. time.gmtime() is still declared
with METH_VARARGS and so it is called with PyCFunction_Call() which is the
target of the test_gdb unit test.

9 years agoMerge 3.4 (test.support)
Victor Stinner [Fri, 27 Mar 2015 14:36:15 +0000 (15:36 +0100)]
Merge 3.4 (test.support)

9 years agoIssue #23445: Fix test.support.python_is_optimized() for CFLAGS=-Og
Victor Stinner [Fri, 27 Mar 2015 14:36:01 +0000 (15:36 +0100)]
Issue #23445: Fix test.support.python_is_optimized() for CFLAGS=-Og

-Og does not optimize the C code, it's just "fast debugging".

9 years agoMerge 3.4 (asyncio)
Victor Stinner [Fri, 27 Mar 2015 14:20:37 +0000 (15:20 +0100)]
Merge 3.4 (asyncio)

9 years agoasyncio: Fix _SelectorTransport.__repr__() if the event loop is closed
Victor Stinner [Fri, 27 Mar 2015 14:20:08 +0000 (15:20 +0100)]
asyncio: Fix _SelectorTransport.__repr__() if the event loop is closed

9 years agoIssue #23715: Fix test_sigtimedwait() of test_eintr
Victor Stinner [Fri, 27 Mar 2015 13:32:22 +0000 (14:32 +0100)]
Issue #23715: Fix test_sigtimedwait() of test_eintr

sigtimedwait([], timeout) fails with OSError(EINVAL) on OpenIndiana, wait for a
signal which will never be received instead.

9 years agoIssue #23451, #22117: Python 3.5 now requires Windows Vista or newer, so
Victor Stinner [Fri, 27 Mar 2015 13:12:08 +0000 (14:12 +0100)]
Issue #23451, #22117: Python 3.5 now requires Windows Vista or newer, so
GetTickCount64() is now always available.

9 years agoIssue #22117: Add a new Python timestamp format _PyTime_t to pytime.h
Victor Stinner [Fri, 27 Mar 2015 12:31:18 +0000 (13:31 +0100)]
Issue #22117: Add a new Python timestamp format _PyTime_t to pytime.h

In practice, _PyTime_t is a number of nanoseconds. Its C type is a 64-bit
signed number. It's integer value is in the range [-2^63; 2^63-1]. In seconds,
the range is around [-292 years; +292 years]. In term of Epoch timestamp
(1970-01-01), it can store a date between 1677-09-21 and 2262-04-11.

The API has a resolution of 1 nanosecond and use integer number. With a
resolution on 1 nanosecond, 64-bit IEEE 754 floating point numbers loose
precision after 194 days. It's not the case with this API. The drawback is
overflow for values outside [-2^63; 2^63-1], but these values are unlikely for
most Python modules, except of the datetime module.

New functions:

- _PyTime_GetMonotonicClock()
- _PyTime_FromObject()
- _PyTime_AsMilliseconds()
- _PyTime_AsTimeval()

This change uses these new functions in time.sleep() to avoid rounding issues.

The new API will be extended step by step, and the old API will be removed step
by step. Currently, some code is duplicated just to be able to move
incrementally, instead of pushing a large change at once.

9 years agoIssue #23648: Document the PEP 475 in the "Porting to Python 3.5" section and
Victor Stinner [Thu, 26 Mar 2015 22:50:57 +0000 (23:50 +0100)]
Issue #23648: Document the PEP 475 in the "Porting to Python 3.5" section and
add a version changed note in modified functions.

9 years ago_PyUnicodeWriter_WriteStr() now checks that the input string is consistent
Victor Stinner [Thu, 26 Mar 2015 08:37:23 +0000 (09:37 +0100)]
_PyUnicodeWriter_WriteStr() now checks that the input string is consistent
in debug mode to detect bugs earlier.

_PyUnicodeWriter_Finish() doesn't check if the read only string is consistent,
whereas it does check consistency for strings built by itself.

9 years agoIssue #23775: pprint() of OrderedDict now outputs the same representation
Serhiy Storchaka [Thu, 26 Mar 2015 06:51:33 +0000 (08:51 +0200)]
Issue #23775: pprint() of OrderedDict now outputs the same representation
as repr().

9 years agoIssue #23776: Removed asserts from pprint.PrettyPrinter constructor.
Serhiy Storchaka [Thu, 26 Mar 2015 06:43:21 +0000 (08:43 +0200)]
Issue #23776: Removed asserts from pprint.PrettyPrinter constructor.

9 years agoIssue #23765: Removed IsBadStringPtr calls in ctypes
Steve Dower [Thu, 26 Mar 2015 04:58:36 +0000 (21:58 -0700)]
Issue #23765: Removed IsBadStringPtr calls in ctypes

9 years agoIssue #22364: Improved some re error messages using regex for hints.
Serhiy Storchaka [Wed, 25 Mar 2015 19:03:47 +0000 (21:03 +0200)]
Issue #22364: Improved some re error messages using regex for hints.

9 years agoCheck that failed writerow() doesn't produce change a file.
Serhiy Storchaka [Wed, 25 Mar 2015 17:16:54 +0000 (19:16 +0200)]
Check that failed writerow() doesn't produce change a file.

9 years agoCheck that failed writerow() doesn't produce change a file.
Serhiy Storchaka [Wed, 25 Mar 2015 17:16:15 +0000 (19:16 +0200)]
Check that failed writerow() doesn't produce change a file.

9 years agoIssue #23742: ntpath.expandvars() no longer loses unbalanced single quotes.
Serhiy Storchaka [Wed, 25 Mar 2015 14:41:15 +0000 (16:41 +0200)]
Issue #23742: ntpath.expandvars() no longer loses unbalanced single quotes.

9 years agoIssue #23742: ntpath.expandvars() no longer loses unbalanced single quotes.
Serhiy Storchaka [Wed, 25 Mar 2015 14:40:15 +0000 (16:40 +0200)]
Issue #23742: ntpath.expandvars() no longer loses unbalanced single quotes.

9 years agoIssue #21717: The zipfile.ZipFile.open function now supports 'x' (exclusive
Serhiy Storchaka [Wed, 25 Mar 2015 08:09:41 +0000 (10:09 +0200)]
Issue #21717: The zipfile.ZipFile.open function now supports 'x' (exclusive
creation) mode.