Commit Graph

10025 Commits

Author SHA1 Message Date
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
Miss Islington (bot) c91bf742e5 bpo-28416: Break reference cycles in Pickler and Unpickler subclasses (GH-4080) (#4653)
with the persistent_id() and persistent_load() methods.
(cherry picked from commit 986375ebde)
2017-11-30 23:30:39 +02:00
Miss Islington (bot) cb79c22039 bpo-31440: Changed default module search path for windows (#4613)
(cherry picked from commit 08d2b86a10)
2017-11-28 18:18:26 +01:00
Victor Stinner 33217d2213
bpo-31701: faulthandler: ignore MSC and COM Windows exception (#3929) (#4416)
(cherry picked from commit 6e3d6b5dc2)
2017-11-16 03:53:45 -08:00
Miss Islington (bot) 18056fb11e bpo-32020: arraymodule: Correct missing Py_DECREF in failure case of make_array() (GH-4391) (#4392)
(cherry picked from commit 56935a53b1)
2017-11-14 09:01:29 +02:00
Miss Islington (bot) 6ed9d4ecde bpo-32013: _pickle: Add missing Py_DECREF in error case in fast_save_enter() (GH-4384) (#4385)
(cherry picked from commit f76231f89a)
2017-11-13 10:19:52 +02:00
Serhiy Storchaka 596286f8f3
[3.6] bpo-31927: Fix bugs in socketmodule.c on NetBSD and other issues. (GH-4235) (#4352)
* Fix compilation of the socket module on NetBSD 8.
* Fix the assertion failure or reading arbitrary data when parse
  a AF_BLUETOOTH address on NetBSD and DragonFly BSD.
* Fix other potential errors and make the code more reliable.
(cherry picked from commit d3187158c0)
2017-11-09 21:40:29 +02:00
Miss Islington (bot) b0331c94c2 bpo-31764: Prevent a crash in sqlite3.Cursor.close() in case the Cursor object is uninitialized (GH-3958) (#4303)
(cherry picked from commit edb13ae48c)
2017-11-06 16:45:19 -08:00
Miss Islington (bot) 9684cf69e3 bpo-31770: Prevent a crash and refleaks when calling sqlite3.Cursor.__init__() more than once (GH-3968) (#4301)
(cherry picked from commit e56ab746a9)
2017-11-06 16:44:23 -08:00
Miss Islington (bot) a512493371 bpo-31933: fix blake2 multi-byte params on big endian platforms (GH-4250) (#4262)
All Blake2 params have to be encoded in little-endian byte order. For
the two multi-byte integer params, leaf_length and node_offset, that
means that assigning a native-endian integer to them appears to work on
little-endian platforms, but gives the wrong result on big-endian. The
current libb2 API doesn't make that very clear, and @sneves is working
on new API functions in the GH issue above. In the meantime, we can work
around the problem by explicitly assigning little-endian values to the
parameter block.

See https://github.com/BLAKE2/libb2/issues/12.
(cherry picked from commit dcfb0e3c04)
2017-11-03 20:55:54 +01:00
Miss Islington (bot) ea80ae04e2 bpo-30057: Fix potential missed signal in signal.signal(). (GH-4258) (#4261)
Bug report and patch by Jeroen Demeyer.
(cherry picked from commit f6f90ff079)
2017-11-03 20:23:12 +01:00
Tal Einat f8b3f6b178 [3.6] bpo-31926: fix missing *_METHODDEF statements by argument clinic (GH-4230) (#4253)
When a single .c file contains several functions and/or methods with
the same name, a safety _METHODDEF GH-define statement is generated
only for one of them.

This fixes the bug by using the full name of the function to avoid
duplicates rather than just the name..
(cherry picked from commit 4f57409a2f)
2017-11-03 06:43:13 -07:00
Miss Islington (bot) aad7ac10af bpo-27666: Fixed stack corruption in curses.box() and curses.ungetmouse(). (GH-4220) (#4221)
(cherry picked from commit 4f469c0966)
2017-11-01 21:23:46 +02:00
Miss Islington (bot) 1f81ea85e8 bpo-15037: Add a workaround for getkey() in curses for ncurses 5.7 and earlier. (GH-3826) (#4218)
Skip a test for unget_wch()/get_wch() on OpenBSD since they are broken
in ncurses 5.7.
(cherry picked from commit 7e68790f3d)
2017-11-01 16:38:35 +02:00