summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* bpo-33812: Corrected astimezone for naive datetimes. (GH-7578) (GH-7601)Miss Islington (bot)2018-06-101-0/+11
| | | | | | | | | | | | | | | | | | | | | A datetime object d is aware if d.tzinfo is not None and d.tzinfo.utcoffset(d) does not return None. If d.tzinfo is None, or if d.tzinfo is not None but d.tzinfo.utcoffset(d) returns None, d is naive. This commit ensures that instances with non-None d.tzinfo, but d.tzinfo.utcoffset(d) returning None are treated as naive. In addition, C acceleration code will raise TypeError if d.tzinfo.utcoffset(d) returns an object with the type other than timedelta. * Updated the documentation. Assume that the term "naive" is defined elsewhere and remove the not entirely correct clarification. Thanks, Tim. (cherry picked from commit 877b23202b7e7d4f57b58504fd0eb886e8c0b377) Co-authored-by: Alexander Belopolsky <abalkin@users.noreply.github.com>
* bpo-33781: audioop: enhance rounding double as int (GH-7447) (GH-7451)Miss Islington (bot)2018-06-061-11/+17
| | | | | | | | | Move the floor() call into fbound() to call floor() on a double rather than an int. The change should enhance the rounding. Document also (int)double rounding mode. (cherry picked from commit 45e4efba7fa2abe61d25e4f8b5bf482e19ff1280) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-33767: Fix improper use of SystemError by mmap.mmap objects (GH-7381)Miss Islington (bot)2018-06-051-20/+2
| | | | | | Raise TypeError instead of SystemError for unsupported operations. (cherry picked from commit e9e397605789b2a67b67558fbbe756b7b88934f5) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-30654: Do not reset SIGINT handler to SIG_DFL in finisignal (GH-7146) ↵Miss Islington (bot)2018-06-011-12/+2
| | | | | | | (GH-7307) (cherry picked from commit e905c84494526363086f66a979e317e155bf9536) Co-authored-by: pkerling <pkerling@casix.org>
* bpo-33677: Fix signatures of tp_clear handlers for AST and deque. (GH-7196) ↵Miss Islington (bot)2018-05-311-3/+4
| | | | | | | (GH-7269) (cherry picked from commit a5c42284e69fb309bdd17ee8c1c120d1be383012) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-33644: Fix signatures of tp_finalize handlers in testing code. (GH-7111) ↵Miss Islington (bot)2018-05-262-4/+2
| | | | | | | (GH-7125) (cherry picked from commit 19de8b3dd742fb53681478ad4fff57ed7c37a953) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.6] bpo-33622: Fix issues with handling errors in the GC. (GH-7078) (GH-7095)Serhiy Storchaka2018-05-241-8/+11
| | | | | | | | | * Fixed a leak when the GC fails to add an object with __del__ into the gc.garbage list. * PyGC_Collect() can now be called when an exception is set and preserves it. * Fixed an undefined behavior with comparing a dead pointer with NULL. (cherry picked from commit 301e3cc8a5bc68c5347ab6ac6f83428000d31ab2)
* bpo-33583: Add note in PyObject_GC_Resize() doc (GH-7021)Miss Islington (bot)2018-05-221-0/+1
| | | | | (cherry picked from commit 1179f4b40f375af5c59cd4b6be9cc313fa0e1a37) Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
* [3.6] bpo-33584: Fix several minor bugs in asyncio. (GH-7003) (#7006)Serhiy Storchaka2018-05-201-6/+6
| | | | | * repr() was called for a borrowed link. * str() was used instead of repr() in formatting one error message. (cherry picked from commit 6655354afcd116c27486bb5ba1dfa50b369d8d85)
* bpo-32282: Remove unnecessary check for `VersionHelpers.h` in ↵Miss Islington (bot)2018-05-181-10/+0
| | | | | `socketmodule.c` on Windows (GH-5120) (cherry picked from commit af11a15c586e980a157c04ee60b6e33dc7228f3f)
* bpo-16865: Support arrays >=2GB in ctypes. (GH-3006)Miss Islington (bot)2018-05-151-8/+8
| | | | | (cherry picked from commit 735abadd5bd91db4a9e6f4311969b0afacca0a1a) Co-authored-by: Segev Finer <segev208@gmail.com>
* bpo-21983: Fix a crash in ctypes.cast() when passed a ctypes structured data ↵Miss Islington (bot)2018-05-091-1/+1
| | | | | | | type (GH-3859) (cherry picked from commit d518d8bc8d5dac1a1270612f424d33e0e5afc2b5) Co-authored-by: Oren Milman <orenmn@gmail.com>
* [3.6] bpo-33383: Fix crash in get() of the dbm.ndbm database object. ↵Serhiy Storchaka2018-04-292-5/+5
| | | | | | (GH-6630). (GH-6633) (cherry picked from commit 2e38cc39330bd7f3003652869b644110a97a78d8)
* [3.6] bpo-33329: Fix multiprocessing regression on newer glibcs (GH-6575) ↵Antoine Pitrou2018-04-231-6/+8
| | | | | | | | | | (GH-6582) Starting with glibc 2.27.9000-xxx, sigaddset() can return EINVAL for some reserved signal numbers between 1 and NSIG. The `range(1, NSIG)` idiom is commonly used to select all signals for blocking with `pthread_sigmask`. So we ignore the sigaddset() return value until we expose sigfillset() to provide a better idiom. (cherry picked from commit 25038ecfb665bef641abf8cb61afff7505b0e008)
* bpo-33308: Fix a crash in the parser module when convert an ST object. (GH-6519)Miss Islington (bot)2018-04-191-3/+3
| | | | | | Converting with line_info=False and col_info=True crashed before. (cherry picked from commit e5362eaa75a154c6e91c5b1c47719d0a0f5ca48b) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-33253: Fix xxsubtype.bench() to accept correct str signature. (GH-6439)Miss Islington (bot)2018-04-101-1/+1
| | | | | (cherry picked from commit f178028f37c9dafb72608b719eb03e5a70af4ff5) Co-authored-by: Devon R <Gorialis@users.noreply.github.com>
* bpo-33209: End framing at the end of C implementation of ↵Miss Islington (bot)2018-04-031-2/+3
| | | | | | | pickle.Pickler.dump(). (GH-6363) (cherry picked from commit c869529ea9fbed574d34cf7ac139ca3f81b62ef0) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.6] Fix error message in sqlite connection thread check. (GH-6028). (GH-6324)Serhiy Storchaka2018-03-311-2/+2
| | | | | (cherry picked from commit 030345c0bfc2f76684666fe5c61e766ba5debfe6) Co-authored-by: Takuya Akiba <469803+iwiwi@users.noreply.github.com>
* bpo-32844: Fix a subprocess misredirection of a low fd (GH5689)Miss Islington (bot)2018-03-261-1/+1
| | | | | | | | | | | | | bpo-32844: subprocess: Fix a potential misredirection of a low fd to stderr. When redirecting, subprocess attempts to achieve the following state: each fd to be redirected to is less than or equal to the fd it is redirected from, which is necessary because redirection occurs in the ascending order of destination descriptors. It fails to do so in a couple of corner cases, for example, if 1 is redirected to 2 and 0 is closed in the parent. (cherry picked from commit 0e7144b064a19493a146af94175a087b3888c37b) Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
* [3.6] bpo-33127: Compatibility patch for LibreSSL 2.7.0 (GH-6210) (GH-6214)Christian Heimes2018-03-241-8/+16
| | | | | | | | | | | | | LibreSSL 2.7 introduced OpenSSL 1.1.0 API. The ssl module now detects LibreSSL 2.7 and only provides API shims for OpenSSL < 1.1.0 and LibreSSL < 2.7. Documentation updates and fixes for failing tests will be provided in another patch set. Signed-off-by: Christian Heimes <christian@python.org>. (cherry picked from commit 4ca0739c9d97ac7cd45499e0d31be68dc659d0e1) Co-authored-by: Christian Heimes <christian@python.org>
* Fix typos in mmap() error messages (GH-6173)Miss Islington (bot)2018-03-211-2/+2
| | | | | (cherry picked from commit 9308dea3e1fd565d50a76a667e4e8ef0568b7053) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* [3.6] bpo-33021: Release the GIL during fstat() calls (GH-6019) (GH-6160)Miss Islington (bot)2018-03-201-2/+9
| | | | | | | | | | | | | | | | fstat may block for long time if the file descriptor is on a non-responsive NFS server, hanging all threads. Most fstat() calls are handled by _Py_fstat(), releasing the GIL internally, but but _Py_fstat_noraise() does not release the GIL, and most calls release the GIL explicitly around it. This patch fixes last 2 calls to _Py_fstat_no_raise(), avoiding hangs when calling: - mmap.mmap() - os.urandom() - random.seed() (cherry picked from commit 4484f9dca9149da135bbae035f10a50d20d1cbbb) Co-authored-by: Nir Soffer <nirsof@gmail.com>
* bpo-32374: m_traverse may be called with m_state=NULL (GH-5140)Miss Islington (bot)2018-03-171-3/+49
| | | | | | | | Multi-phase initialized modules allow m_traverse to be called while the module is still being initialized, so module authors may need to account for that. (cherry picked from commit c2b0b12d1a137ada1023ab7c10b8d9a0249d95f9) Co-authored-by: Marcel Plch <gmarcel.plch@gmail.com>
* bpo-30622: Fix backport of NPN fix (#6102)Christian Heimes2018-03-141-1/+1
| | | | | Fix backport a79591cf of bpo-30622 to 3.6 branch. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-33016: Fix potential use of uninitialized memory in nt._getfinalpathname ↵Steve Dower2018-03-081-22/+32
| | | | (GH-6032)
* [3.6] bpo-30353: Fix pass by value for structs on 64-bit Cygwin/MinGW ↵Miss Islington (bot)2018-03-082-2/+39
| | | | | | | | (GH-1559) (GH-5954) (cherry picked from commit 9ba3aa4d02a110d1a1ea464a8aff3be7dd9c63c3) Co-authored-by: Erik Bray <erik.m.bray@gmail.com>
* bpo-32969: Expose some missing constants in zlib and fix the doc (GH-5988)Miss Islington (bot)2018-03-071-3/+18
| | | | | (cherry picked from commit bc3f2289b9007396bfb7f986bee477b6176c1822) Co-authored-by: Xiang Zhang <angwerzx@126.com>
* [3.6] bpo-33001: Prevent buffer overrun in os.symlink (GH-5989) (GH-5990)Steve Dower2018-03-051-28/+38
|
* bpo-32903: Fix a memory leak in os.chdir() on Windows (GH-5801) (#5946)Miss Islington (bot)2018-03-011-7/+7
| | | | | (cherry picked from commit 3e197c7a6740d564ad52fb7901c07d5ff49460f5) Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
* [3.6] bpo-32922: dbm.open() now encodes filename with the filesystem ↵Serhiy Storchaka2018-02-274-18/+45
| | | | | | | encoding. (GH-5832). (GH-5906) (cherry picked from commit 6f600ff1734ca2fdcdd37a809adf8130f0d8cc4e) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Fix _socket module compilation on Cygwin. (GH-4137) (GH-4145)Miss Islington (bot)2018-02-261-1/+1
| | | (cherry picked from commit 63ae04461fb0cc93ca57cd151103a8dd295581d6)
* [3.6] bpo-32394: Remove some TCP options on older version Windows. (GH-5585)animalize2018-02-261-0/+67
|
* [3.6] bpo-30622: Fix NPN for OpenSSL 1.1.1-pre1 (GH-5876) (#5881)Christian Heimes2018-02-252-24/+29
| | | | | | Signed-off-by: Christian Heimes <christian@python.org>. (cherry picked from commit 29eab55309b9f78b79074d26db16a44e7841c639) Co-authored-by: Christian Heimes <christian@python.org>
* [3.6] bpo-30622: Improve NPN support detection (GH-5859) (#5861)Christian Heimes2018-02-252-11/+24
| | | | | | | | | The ssl module now detects missing NPN support in LibreSSL. Co-Authored-By: Bernard Spil <brnrd@FreeBSD.org> Signed-off-by: Christian Heimes <christian@python.org>. (cherry picked from commit 6cdb7954b0a578d899e4b78b868ea59eef08480a) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-32185: Don't send IP in SNI TLS extension (#5865)Christian Heimes2018-02-251-2/+40
| | | | | | The SSL module no longer sends IP addresses in SNI TLS extension on platforms with OpenSSL 1.0.2+ or inet_pton. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-17232: Clarify docs for -O and -OO command line options (GH-5839)Miss Islington (bot)2018-02-251-2/+4
| | | | | | The 'optimization' is for space in the executable file, not for run time. (cherry picked from commit 186b606d8a2ea4fd51b7286813302c8e8c7006cc) Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
* bpo-31966: Fixed WindowsConsoleIO.write() for writing empty data. (GH-5754)Miss Islington (bot)2018-02-241-0/+3
| | | | | (cherry picked from commit 42c35d9c0c8175332f50fbe034a001fe52f057b9) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* closes bpo-32859: Don't retry dup3() if it is not available at runtime (GH-5708)Miss Islington (bot)2018-02-211-1/+1
| | | | | | | | | | | os.dup2() tests for dup3() system call availability at runtime, but doesn't remember the result across calls, repeating the test on each call with inheritable=False. Since the caller of os.dup2() is expected to hold the GIL, fix this by making the variable holding the test result static. (cherry picked from commit b3caf388a0418f6c031e4dbdcc0c1ce7e5cc36bd) Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
* Update comment in posixmodule.c (GH-5681)Miss Islington (bot)2018-02-141-1/+1
| | | | | | | | A closing parentheses was missing. Signed-off-by: Ngie Cooper <yaneurabeya@gmail.com> (cherry picked from commit 7745ec4e356ac1f4eaf43b155f4482c20a907d48) Co-authored-by: ngie-eign <1574099+ngie-eign@users.noreply.github.com>
* bpo-31787: Prevent refleaks when calling __init__() more than once (GH-3995)INADA Naoki2018-02-134-9/+21
| | | (cherry picked from commit d019bc8319ea35e93bf4baa38098ff1b57cd3ee5)
* bpo-29248: Fix os.readlink() on Windows (GH-5577)Miss Islington (bot)2018-02-121-3/+3
| | | | | | | | The PrintNameOffset field of the reparse data buffer was treated as a number of characters instead of bytes. (cherry picked from commit 3c34aad4e7a95913ec7db8e5e948a8fc69047bf7) Co-authored-by: SSE4 <tomskside@gmail.com>
* bpo-32777: Fix _Py_set_inheritable async-safety in subprocess (GH-5560) ↵Miss Islington (bot)2018-02-061-4/+4
| | | | | | | | | | | | (GH-5563) Fix a rare but potential pre-exec child process deadlock in subprocess on POSIX systems when marking file descriptors inheritable on exec in the child process. This bug appears to have been introduced in 3.4 with the inheritable file descriptors support. This also changes Python/fileutils.c `set_inheritable` to use the "slow" two `fcntl` syscall path instead of the "fast" single `ioctl` syscall path when asked to be async signal safe (by way of being asked not to raise exceptions). `ioctl` is not a POSIX async-signal-safe approved function. ref: http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html (cherry picked from commit c1e46e94de38a92f98736af9a42d89c3975a9919) Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
* [3.6] bpo-32746: Fix multiple typos (GH-5144) (GH-5522)Terry Jan Reedy2018-02-044-4/+4
| | | | | | | | | Fix typos found by codespell in docs, docstrings, and comments. Fixes for the following files were in post-3.6 code and not backported: Lib/ctypes/_aix.py (new), Lib/test/test_concurrent_futures.py, Modules/_asynciomodule.c, Modules/_pickle.c, Objects/obmalloc.c. (cherry picked from commit c3d9508ff22ece9a96892b628dd5813e2fb0cd80)
* bpo-31106: Fix handling of erros in posix_fallocate() and posix_fadvise() ↵Miss Islington (bot)2018-02-011-10/+20
| | | | | (GH-3000) (GH-3000) (#4101) (cherry picked from commit d4b93e21c2664d6a78e0656e7a7be0807be1c352)
* [3.6] bpo-32228: Reset raw_pos after unwinding the raw stream (GH-4858) (#5389)Antoine Pitrou2018-01-281-4/+10
| | | | | Ensure that ``truncate()`` preserves the file position (as reported by ``tell()``) after writes longer than the buffer size.. (cherry picked from commit 059f58ce938d9c3f0286412a4efb1b9131339421)
* [3.6] bpo-31900: Fix localeconv() encoding for LC_NUMERIC (#4174) (#5192)Victor Stinner2018-01-151-6/+26
| | | | | | | | | | * Add _Py_GetLocaleconvNumeric() function: decode decimal_point and thousands_sep fields of localeconv() from the LC_NUMERIC encoding, rather than decoding from the LC_CTYPE encoding. * Modify locale.localeconv() and "n" formatter of str.format() (for int, float and complex to use _Py_GetLocaleconvNumeric() internally. (cherry picked from commit cb064fc2321ce8673fe365e9ef60445a27657f54)
* correct the typos (GH-4950) (#4951)Miss Islington (bot)2017-12-211-2/+2
| | | (cherry picked from commit 83cb778b4a3f856f2243b0f0d36fefb5c44b388f)
* bpo-32329: Fix sys.flags.hash_randomization (#4875)Victor Stinner2017-12-151-1/+0
| | | | sys.flags.hash_randomization is now properly set to 0 when hash randomization is turned off by PYTHONHASHSEED=0.
* bpo-32277: Fix exception raised from chmod(..., follow_symlinks=False) ↵Miss Islington (bot)2017-12-141-0/+1
| | | | | (GH-4797) (#4869) (cherry picked from commit 233ef249cc5c18d796fb581747179c5e062b4083)
* [3.6] bpo-32297: Fix misspellings in Python source code comments (GH-4803) ↵Andrew Svetlov2017-12-141-1/+1
| | | | | | | | | | | | | | (#4864) * [3.6] bpo-32297: Few misspellings found in Python source code comments. (GH-4803) * Fix multiple typos in code comments * Add spacing in comments (test_logging.py, test_math.py) * Fix spaces at the beginning of comments in test_logging.py. (cherry picked from commit 53f7a7c2814fbfd8a29200926601a32fa48bacb3)