Commit Graph

10038 Commits

Author SHA1 Message Date
Miss Islington (bot) 1d5198fd41 bpo-30654: Do not reset SIGINT handler to SIG_DFL in finisignal (GH-7146) (GH-7307)
(cherry picked from commit e905c84494)

Co-authored-by: pkerling <pkerling@casix.org>
2018-06-01 13:12:11 +02:00
Miss Islington (bot) 0fe3be0392 bpo-33677: Fix signatures of tp_clear handlers for AST and deque. (GH-7196) (GH-7269)
(cherry picked from commit a5c42284e6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-05-31 09:10:28 +03:00
Miss Islington (bot) 9ba3be4718 bpo-33644: Fix signatures of tp_finalize handlers in testing code. (GH-7111) (GH-7125)
(cherry picked from commit 19de8b3dd7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-05-26 13:17:08 +03:00
Serhiy Storchaka f0e04b2ae2
[3.6] bpo-33622: Fix issues with handling errors in the GC. (GH-7078) (GH-7095)
* 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 301e3cc8a5)
2018-05-24 16:05:38 +03:00
Miss Islington (bot) 0c1e7d8122
bpo-33583: Add note in PyObject_GC_Resize() doc (GH-7021)
(cherry picked from commit 1179f4b40f)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
2018-05-21 19:18:41 -07:00
Serhiy Storchaka 49418f6df7
[3.6] bpo-33584: Fix several minor bugs in asyncio. (GH-7003) (#7006)
* repr() was called for a borrowed link.
* str() was used instead of repr() in formatting one error message.
(cherry picked from commit 6655354afc)
2018-05-20 17:33:55 +03:00
Miss Islington (bot) 09eb6fe8fd bpo-32282: Remove unnecessary check for `VersionHelpers.h` in `socketmodule.c` on Windows (GH-5120)
(cherry picked from commit af11a15c58)
2018-05-18 20:38:19 +03:00
Miss Islington (bot) 726894addc
bpo-16865: Support arrays >=2GB in ctypes. (GH-3006)
(cherry picked from commit 735abadd5b)

Co-authored-by: Segev Finer <segev208@gmail.com>
2018-05-14 22:55:52 -07:00
Miss Islington (bot) 8ac158a6df
bpo-21983: Fix a crash in ctypes.cast() when passed a ctypes structured data type (GH-3859)
(cherry picked from commit d518d8bc8d)

Co-authored-by: Oren Milman <orenmn@gmail.com>
2018-05-09 15:27:59 -07:00
Serhiy Storchaka 1b27ec6e0b
[3.6] bpo-33383: Fix crash in get() of the dbm.ndbm database object. (GH-6630). (GH-6633)
(cherry picked from commit 2e38cc3933)
2018-04-29 15:44:16 +03:00
Antoine Pitrou b0ca398cab
[3.6] bpo-33329: Fix multiprocessing regression on newer glibcs (GH-6575) (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 25038ecfb6)
2018-04-23 22:22:49 +02:00
Miss Islington (bot) fc8693dc7a
bpo-33308: Fix a crash in the parser module when convert an ST object. (GH-6519)
Converting with line_info=False and col_info=True crashed before.
(cherry picked from commit e5362eaa75)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-04-18 22:11:05 -07:00
Miss Islington (bot) 910d71b839
bpo-33253: Fix xxsubtype.bench() to accept correct str signature. (GH-6439)
(cherry picked from commit f178028f37)

Co-authored-by: Devon R <Gorialis@users.noreply.github.com>
2018-04-09 23:07:14 -07:00
Miss Islington (bot) a5c8830637
bpo-33209: End framing at the end of C implementation of pickle.Pickler.dump(). (GH-6363)
(cherry picked from commit c869529ea9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-04-03 15:05:11 -07:00
Serhiy Storchaka d918bbda4b
[3.6] Fix error message in sqlite connection thread check. (GH-6028). (GH-6324)
(cherry picked from commit 030345c0bf)

Co-authored-by: Takuya Akiba <469803+iwiwi@users.noreply.github.com>
2018-04-01 01:03:50 +03:00
Miss Islington (bot) 57db13e582
bpo-32844: Fix a subprocess misredirection of a low fd (GH5689)
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 0e7144b064)

Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
2018-03-26 13:43:46 -07:00
Christian Heimes f5befbb0d1
[3.6] bpo-33127: Compatibility patch for LibreSSL 2.7.0 (GH-6210) (GH-6214)
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 4ca0739c9d)

Co-authored-by: Christian Heimes <christian@python.org>
2018-03-24 18:38:14 +01:00
Miss Islington (bot) 7abf34344f
Fix typos in mmap() error messages (GH-6173)
(cherry picked from commit 9308dea3e1)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-03-21 00:07:23 -07:00
Miss Islington (bot) f3e6eadbcf [3.6] bpo-33021: Release the GIL during fstat() calls (GH-6019) (GH-6160)
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 4484f9dca9)

Co-authored-by: Nir Soffer <nirsof@gmail.com>
2018-03-20 20:40:18 +01:00
Miss Islington (bot) 1da0479f68
bpo-32374: m_traverse may be called with m_state=NULL (GH-5140)
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 c2b0b12d1a)

Co-authored-by: Marcel Plch <gmarcel.plch@gmail.com>
2018-03-16 23:29:30 -07:00
Christian Heimes 0ec0290a07
bpo-30622: Fix backport of NPN fix (#6102)
Fix backport a79591cf of bpo-30622 to 3.6 branch.

Signed-off-by: Christian Heimes <christian@python.org>
2018-03-14 07:40:20 +01:00
Steve Dower 32efcd1306
bpo-33016: Fix potential use of uninitialized memory in nt._getfinalpathname (GH-6032) 2018-03-08 14:50:30 -08:00
Miss Islington (bot) 2f3ba27185 [3.6] bpo-30353: Fix pass by value for structs on 64-bit Cygwin/MinGW (GH-1559) (GH-5954)
(cherry picked from commit 9ba3aa4d02)

Co-authored-by: Erik Bray <erik.m.bray@gmail.com>
2018-03-08 10:28:53 -05:00
Miss Islington (bot) 7592c0a686
bpo-32969: Expose some missing constants in zlib and fix the doc (GH-5988)
(cherry picked from commit bc3f2289b9)

Co-authored-by: Xiang Zhang <angwerzx@126.com>
2018-03-06 21:46:10 -08:00
Steve Dower baa4507946
[3.6] bpo-33001: Prevent buffer overrun in os.symlink (GH-5989) (GH-5990) 2018-03-05 14:26:28 -08:00
Miss Islington (bot) 10fb1bf776 bpo-32903: Fix a memory leak in os.chdir() on Windows (GH-5801) (#5946)
(cherry picked from commit 3e197c7a67)

Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
2018-03-01 18:28:20 +08:00
Serhiy Storchaka 5bf74859fe
[3.6] bpo-32922: dbm.open() now encodes filename with the filesystem encoding. (GH-5832). (GH-5906)
(cherry picked from commit 6f600ff173)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-02-27 03:39:53 +02:00
Miss Islington (bot) e650fd362e Fix _socket module compilation on Cygwin. (GH-4137) (GH-4145)
(cherry picked from commit 63ae04461f)
2018-02-26 22:24:18 +02:00
animalize 1278c21f52 [3.6] bpo-32394: Remove some TCP options on older version Windows. (GH-5585) 2018-02-26 10:13:51 -08:00
Christian Heimes a79591cfb8
[3.6] bpo-30622: Fix NPN for OpenSSL 1.1.1-pre1 (GH-5876) (#5881)
Signed-off-by: Christian Heimes <christian@python.org>.
(cherry picked from commit 29eab55309)

Co-authored-by: Christian Heimes <christian@python.org>
2018-02-25 14:29:00 +01:00
Christian Heimes 48707a1baf
[3.6] bpo-30622: Improve NPN support detection (GH-5859) (#5861)
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 6cdb7954b0)

Co-authored-by: Christian Heimes <christian@python.org>
2018-02-25 10:20:47 +01:00
Christian Heimes e9370a4738
bpo-32185: Don't send IP in SNI TLS extension (#5865)
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>
2018-02-25 09:47:02 +01:00
Miss Islington (bot) fc9471a888
bpo-17232: Clarify docs for -O and -OO command line options (GH-5839)
The 'optimization' is for space in the executable file, not for run time.
(cherry picked from commit 186b606d8a)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-02-24 19:46:16 -08:00
Miss Islington (bot) 980790eee0
bpo-31966: Fixed WindowsConsoleIO.write() for writing empty data. (GH-5754)
(cherry picked from commit 42c35d9c0c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-02-24 09:43:05 -08:00
Miss Islington (bot) 16de2a9b86 closes bpo-32859: Don't retry dup3() if it is not available at runtime (GH-5708)
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 b3caf388a0)

Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
2018-02-20 21:21:12 -08:00
Miss Islington (bot) f62a9d41b5
Update comment in posixmodule.c (GH-5681)
A closing parentheses was missing.

Signed-off-by: Ngie Cooper <yaneurabeya@gmail.com>
(cherry picked from commit 7745ec4e35)

Co-authored-by: ngie-eign <1574099+ngie-eign@users.noreply.github.com>
2018-02-14 13:16:36 -08:00
INADA Naoki 4731634241
bpo-31787: Prevent refleaks when calling __init__() more than once (GH-3995)
(cherry picked from commit d019bc8319)
2018-02-13 22:15:24 +09:00
Miss Islington (bot) a1d33f7425 bpo-29248: Fix os.readlink() on Windows (GH-5577)
The PrintNameOffset field of the reparse data buffer
was treated as a number of characters instead of bytes.

(cherry picked from commit 3c34aad4e7)

Co-authored-by: SSE4 <tomskside@gmail.com>
2018-02-12 21:14:08 +03:00
Miss Islington (bot) b90c68586e bpo-32777: Fix _Py_set_inheritable async-safety in subprocess (GH-5560) (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 c1e46e94de)

Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
2018-02-05 22:51:10 -08:00
Terry Jan Reedy c90a5dec03
[3.6] bpo-32746: Fix multiple typos (GH-5144) (GH-5522)
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 c3d9508ff2)
2018-02-03 21:00:24 -05:00
Miss Islington (bot) 3a04c52a9e bpo-31106: Fix handling of erros in posix_fallocate() and posix_fadvise() (GH-3000) (GH-3000) (#4101)
(cherry picked from commit d4b93e21c2)
2018-02-01 16:07:08 +02:00
Antoine Pitrou 1d896ed2cd
[3.6] bpo-32228: Reset raw_pos after unwinding the raw stream (GH-4858) (#5389)
Ensure that ``truncate()`` preserves the file position (as reported by ``tell()``) after writes longer than the buffer size..
(cherry picked from commit 059f58ce93)
2018-01-28 18:42:31 +01:00
Victor Stinner 5f959c4f9e
[3.6] bpo-31900: Fix localeconv() encoding for LC_NUMERIC (#4174) (#5192)
* 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 cb064fc232)
2018-01-15 23:23:47 +01:00
Miss Islington (bot) 020668b8e1 correct the typos (GH-4950) (#4951)
(cherry picked from commit 83cb778b4a)
2017-12-21 07:43:11 +02:00
Victor Stinner 22097aaa77
bpo-32329: Fix sys.flags.hash_randomization (#4875)
sys.flags.hash_randomization is now properly set to 0 when hash
randomization is turned off by PYTHONHASHSEED=0.
2017-12-15 01:39:48 +01:00
Miss Islington (bot) d1cb1067a8 bpo-32277: Fix exception raised from chmod(..., follow_symlinks=False) (GH-4797) (#4869)
(cherry picked from commit 233ef249cc)
2017-12-14 19:30:45 +02:00
Andrew Svetlov 28453feaa8
[3.6] bpo-32297: Fix misspellings in Python source code comments (GH-4803) (#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 53f7a7c281)
2017-12-14 16:19:51 +02:00
Miss Islington (bot) ce5a3cd9b1 bpo-32255: Always quote a single empty field when write into a CSV file. (GH-4769) (#4810)
This allows to distinguish an empty row from a row consisting of a single empty field.
(cherry picked from commit 2001900b0c)
2017-12-12 12:56:40 +02:00
Miss Islington (bot) 71d8f36eb4 bpo-32252: Fix faulthandler_suppress_crash_report() (GH-4794) (#4795)
Fix faulthandler_suppress_crash_report() used to prevent core dump files
when testing crashes. getrlimit() returns zero on success.
(cherry picked from commit 48d4dd974f)
2017-12-11 14:17:06 +01:00
Miss Islington (bot) 8bcd41040a bpo-32186: Release the GIL during lseek and fstat (GH-4652) (#4661)
In _io_FileIO_readall_impl(), lseek() and _Py_fstat_noraise() were called
without releasing the GIL. This can cause all threads to hang for
unlimited time when calling FileIO.read() and the NFS server is not
accessible.
(cherry picked from commit 6a89481680)
2017-12-01 07:26:31 +01:00