Commit Graph

10075 Commits

Author SHA1 Message Date
Benjamin Peterson 2c134c3125 convert from long long to PyLong loselessly (#1106) 2017-04-13 10:44:54 +02:00
Serhiy Storchaka b879fe82e7 Expand the PySlice_GetIndicesEx macro. (#1023) 2017-04-08 09:53:51 +03:00
Mark Dickinson a0ce375e10 bpo-29962: add math.remainder (#950)
* Implement math.remainder.

* Fix markup for arguments; use double spaces after period.

* Mark up function reference in what's new entry.

* Add comment explaining the calculation in the final branch.

* Fix out-of-order entry in whatsnew.

* Add comment explaining why it's good enough to compare m with c, in spite of possible rounding error.
2017-04-05 18:34:27 +01:00
Andrew Nester f78b119364 bpo-29649: Improve struct.pack_into() boundary error messages (#424) 2017-04-04 13:46:25 +03:00
Angus Hollands 8614b59910 Correct typo (#976) 2017-04-03 18:16:14 +02:00
Serhiy Storchaka 314d6fca36 bpo-29953: Fix memory leaks in the replace() method of datetime and time (#927)
objects when pass out of bound fold argument.
2017-03-31 22:48:16 +03:00
Benjamin Peterson 164d30eb1e suppress compiler warnings in _ctypes_test (#902)
Changed test code to suppress a compiler warning, while taking care to avoid the code being optimized out by the compiler.
2017-03-31 12:05:25 +01:00
Louie Lu 7a26464c64 bpo-29946: Fix "sqrtpi defined but not used" (#908) 2017-03-30 20:05:10 +03:00
T. Wouters 5466d4af5f bpo-29942: Fix the use of recursion in itertools.chain.from_iterable. (#889)
Fix the use of recursion in itertools.chain.from_iterable. Using recursion
is unnecessary, and can easily cause stack overflows, especially when
building in low optimization modes or with Py_DEBUG enabled.
2017-03-30 09:58:35 -07:00
Serhiy Storchaka d4edfc9abf bpo-29935: Fixed error messages in the index() method of tuple, list and deque (#887)
when pass indices of wrong type.
2017-03-30 18:29:23 +03:00
Serhiy Storchaka 762ec97ea6 bpo-29204: Emit warnings for already deprecated ElementTree features. (#773)
Element.getiterator() and the html parameter of XMLParser() were
deprecated only in the documentation (since Python 3.2 and 3.4 correspondintly).
Now using them emits a deprecation warning.

* Don’t need check_warnings any more.
2017-03-30 18:12:06 +03:00
Serhiy Storchaka 576def096e bpo-27863: Fixed multiple crashes in ElementTree. (#765) 2017-03-30 09:47:31 +03:00
Serhiy Storchaka 762bf40438 bpo-29852: Argument Clinic Py_ssize_t converter now supports None (#716)
if pass `accept={int, NoneType}`.
2017-03-30 09:15:31 +03:00
Serhiy Storchaka ea720fe7e9 bpo-25996: Added support of file descriptors in os.scandir() on Unix. (#502)
os.fwalk() is sped up by 2 times by using os.scandir().
2017-03-30 09:12:31 +03:00
Serhiy Storchaka ba85d69a3e bpo-29878: Add global instances of int for 0 and 1. (#852) 2017-03-30 09:09:41 +03:00
Sylvain a90e64b78d bpo-29932: Fix small error message typos in arraymodule.c (GH-888) 2017-03-29 11:09:22 -07:00
Victor Stinner d6debb24e0 bpo-29919: Remove unused imports found by pyflakes (#137)
Make also minor PEP8 coding style fixes on modified imports.
2017-03-27 16:05:26 +02:00
Serhiy Storchaka 3c749fc867 Simplify partial.__new__. (#813)
Fast paths in partial.__new__ no longer needed since concatenating with empty
tuple was optimized.
2017-03-25 11:10:16 +01:00
Christophe Zeitouny 20fbf8accd faulthandler: Restore the old sigaltstack during teardown (#777) 2017-03-23 18:14:29 +01:00
Serhiy Storchaka 0b3ec19225 Use NULL rather than 0. (#778)
There was few cases of using literal 0 instead of NULL in the context of
pointers.  While this was a legitimate C code, using NULL rather than 0 makes
the code clearer.
2017-03-23 17:53:47 +02:00
Serhiy Storchaka aefa7ebf0f bpo-6532: Make the thread id an unsigned integer. (#781)
* bpo-6532: Make the thread id an unsigned integer.

From C API side the type of results of PyThread_start_new_thread() and
PyThread_get_thread_ident(), the id parameter of
PyThreadState_SetAsyncExc(), and the thread_id field of PyThreadState
changed from "long" to "unsigned long".

* Restore a check in thread_get_ident().
2017-03-23 14:48:39 +01:00
Nathaniel J. Smith 1e2147b9d7 bpo-29728: Provide socket.TCP_NOTSENT_LOWAT (#477)
* Provide socket.TCP_NOTSENT_LOWAT
* New TCP option available on recent MacOS and Linux.
* Document addition of TCP_NOTSENT_LOWAT
2017-03-22 20:56:55 -07:00
Serhiy Storchaka fff9a31a91 bpo-29865: Use PyXXX_GET_SIZE macros rather than Py_SIZE for concrete types. (#748) 2017-03-21 08:53:25 +02:00
Serhiy Storchaka a5af6e1af7 bpo-25455: Fixed crashes in repr of recursive buffered file-like objects. (#514) 2017-03-19 19:25:29 +02:00
Michael Seifert 6c3d527468 bpo-29800: Fix crashes in partial.__repr__ if the keys of partial.keywords are not strings (#649) 2017-03-15 07:26:33 +02:00
Victor Stinner 0f7b0b397e bpo-29735: Optimize partial_call(): avoid tuple (#516)
* Add _PyObject_HasFastCall()
* partial_call() now avoids temporary tuple to pass positional
  arguments if the callable supports the FASTCALL calling convention
  for positional arguments.
* Fix also a performance regression in partial_call() if the callable
  doesn't support FASTCALL.
2017-03-14 21:37:20 +01:00
Oren Milman 004251059b bpo-29730: replace some calls to PyNumber_Check and improve some error messages (#650) 2017-03-13 00:37:05 +02:00
Serhiy Storchaka 783d0c1a1c bpo-28667: Fix a compile warning on FreeBSD when compare with FD_SETSIZE. (#501)
FreeBSD is the only platforms with unsigned FD_SETSIZE.
2017-03-12 14:43:12 +02:00
Serhiy Storchaka 4125e5c60e bpo-26121: Revert to using the own implementations of lgamma and gamma on all platforms. (#637) 2017-03-12 14:08:06 +02:00
Serhiy Storchaka 1989763f0d bpo-20185: Convert the resource moduel to Argument Clinic. (#545)
Based on patch by Vajrasky Kok.
2017-03-12 13:08:30 +02:00
Nick Coghlan d2977a3ae2 bpo-29723: Consistently configure sys.path[0] (#575)
Directory and zipfile execution previously added
the parent directory of the directory or zipfile
as sys.path[0] and then subsequently overwrote
it with the directory or zipfile itself.

This caused problems in isolated mode, as it
overwrote the "stdlib as a zip archive" entry
in sys.path, as the parent directory was
never added.

The attempted fix to that issue in bpo-29319
created the opposite problem in *non*-isolated
mode, by potentially leaving the parent
directory on sys.path instead of overwriting it.

This change fixes the root cause of the problem
by removing the whole "add-and-overwrite" dance
for sys.path[0], and instead simply never adds
the parent directory to sys.path in the first
place.
2017-03-12 20:38:32 +10:00
Serhiy Storchaka 8999caeb00 bpo-15695: Implemented StgDict.__sizeof__(). (#509) 2017-03-12 11:12:30 +02:00
Serhiy Storchaka 202fda55c2 bpo-24037: Add Argument Clinic converter `bool(accept={int})`. (#485) 2017-03-12 10:10:47 +02:00
Serhiy Storchaka 97553fdf9d bpo-26121: Use C library implementation for math functions: (#515)
* bpo-26121: Use C library implementation for math functions:
tgamma(), lgamma(), erf() and erfc().

* Don't use tgamma() and lgamma() from libc on OS X.
2017-03-11 21:37:16 +00:00
Xiang Zhang 0710d75425 bpo-29770: remove outdated PYO related info (GH-590) 2017-03-11 13:02:52 +08:00
orenmn 740025478d bpo-29741: Clean up C implementations of BytesIO and StringIO. (#606)
Some BytesIO methods now accept not just int subclasses but other int-like types.
2017-03-11 00:52:01 +02:00
Victor Stinner 0f6d73343d bpo-29619: Convert st_ino using unsigned integer (#557)
bpo-29619: os.stat() and os.DirEntry.inodeo() now convert inode
(st_ino) using unsigned integers.
2017-03-09 17:34:28 +01:00
orenmn 964281af59 bpo-28298: make array 'Q', 'L' and 'I' accept big intables as elements (#570) 2017-03-09 11:35:28 +02:00
Serhiy Storchaka 22e707fa04 bpo-29768: Fixed compile-time check for expat version. (#574) 2017-03-09 09:47:52 +02:00
Benjamin Peterson ad4a0cc519 allow the first call to wcsxfrm to return ERANGE (#536)
If the output buffer provided to wcsxfrm is too small, errno is set to ERANGE. We should not error out in that case.
2017-03-07 22:24:44 -08:00
Serhiy Storchaka be487a65f1 bpo-15954: Check return code of wcsxfrm(). (#508) 2017-03-06 21:21:41 +02:00
Ned Deily 5c4b0d063a bpo-27593: Get SCM build info from git instead of hg. (#446)
sys.version and the platform module python_build(),
python_branch(), and python_revision() functions now use
git information rather than hg when building from a repo.

Based on original patches by Brett Cannon and Steve Dower.
2017-03-04 00:19:55 -05:00
Aviv Palivoda 86a670543f bpo-9303: Migrate sqlite3 module to _v2 API to enhance performance (#359) 2017-03-03 13:58:17 +03:00
Yury Selivanov 84af903f3b bpo-28963: Fix out of bound iteration in asyncio.Future.remove_done_callback/C (#408) 2017-03-02 23:46:56 -05:00
Yury Selivanov 8d26aa930c bpo-29271: Fix Task.current_task and Task.all_tasks to accept None. (#406) 2017-03-02 22:16:33 -05:00
orenmn 1bea762d9e bpo-28129: fix ctypes crashes (#386)
* init commit, with initial tests for from_param and fields __set__ and __get__, and some additions to from_buffer and from_buffer_copy

* added the rest of tests and patches. probably only a first draft.

* removed trailing spaces

* replace ctype with ctypes in error messages

* change back from ctypes instance to ctype instance
2017-03-02 18:42:40 +01:00
Donald Stufft 8ae264ce6d bpo-29697: Don't use OpenSSL <1.0.2 fallback on 1.1+ (GH-395) 2017-03-02 11:45:29 -05:00
orenmn 698845eba7 fix an error message and a comment in _testcapimodule.c (GH-392) 2017-03-02 20:29:20 +09:00
Christian Heimes 2b221b78d6 bpo-29176 Use tmpfile() in curses module (#235)
The curses module used mkstemp() + fopen() to create a temporary file in
/tmp. The /tmp directory does not exist on Android. The tmpfile()
function simplifies the task a lot. It creates a temporary file in a
correct directory, takes care of cleanup and returns FILE*.

tmpfile is supported on all platforms (C89, POSIX 2001, Android,
Windows).

Signed-off-by: Christian Heimes <christian@python.org>
2017-03-02 11:09:01 +01:00
Berker Peksag 4a926caf8e bpo-28518: Start a transaction implicitly before a DML statement (#245)
Patch by Aviv Palivoda.
2017-02-26 18:22:38 +03:00