Commit Graph

10559 Commits

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

Co-authored-by: pkerling <pkerling@casix.org>
2018-06-01 12:50:24 +02:00
Miss Islington (bot) c6de46e180
bpo-33706: Fix pymain_parse_cmdline_impl() (GH-7283)
Fix a crash in Python initialization when parsing the command line
options.

Fix memcpy() size parameter: previously, we read one wchar_t after
the end of _PyOS_optarg. Moreover, don't copy the trailingg NUL
character: we write it manually anyway.

Thanks Christoph Gohlke for the bug report and the fix!
(cherry picked from commit 58d1683255)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-05-31 06:43:21 -07:00
Miss Islington (bot) a4dd46a47f
bpo-33677: Fix signatures of tp_clear handlers for AST and deque. (GH-7196)
(cherry picked from commit a5c42284e6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-05-30 22:31:21 -07:00
Miss Islington (bot) ddc613f203
bpo-32610: Fix asyncio.all_tasks() to return only pending tasks. (GH-7174)
(cherry picked from commit 416c1ebd98)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-05-28 17:16:43 -07:00
Miss Islington (bot) 51d0a2c8dd
bpo-33623: Fix possible SIGSGV when asyncio.Future is created in __del__ (GH-7080)
(cherry picked from commit 35230d08e0)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-05-28 08:28:12 -07:00
Miss Islington (bot) e60f6e1864
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-26 11:39:52 -07:00
Miss Islington (bot) 14d289be60
bpo-33644: Fix signatures of tp_finalize handlers in testing code. (GH-7111)
(cherry picked from commit 19de8b3dd7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-05-26 01:33:23 -07:00
Miss Islington (bot) 5734f41a9b
bpo-32493: Fix uuid.uuid1() on FreeBSD. (GH-7099)
Use uuid_enc_be() if available to encode UUID to bytes as big endian.
(cherry picked from commit 17d8830312)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-05-24 16:22:59 -07:00
Miss Islington (bot) 2fe940c727
bpo-33622: Fix issues with handling errors in the GC. (GH-7078)
* 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)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-05-24 05:39:08 -07:00
Miss Islington (bot) 2b4ed5da1d 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 23:51:00 +09:00
Miss Islington (bot) 52d1741c95 bpo-33584: Fix several minor bugs in asyncio. (GH-7003) (GH-7005)
Fix the following bugs in the C implementation:

* get_future_loop() silenced all exceptions raised when look up the get_loop
  attribute, not just an AttributeError.
* enter_task() silenced all exceptions raised when look up the current task,
  not just a KeyError.
* repr() was called for a borrowed link in enter_task() and task_step_impl().
* str() was used instead of repr() in formatting one error message (in
  Python implementation too).
* There where few reference leaks in error cases.
(cherry picked from commit 6655354afc)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-05-20 17:34:28 +03:00
Miss Islington (bot) 6414da93ed Fix typo in error message when decoding PYTHONPATH. (GH-6981) (GH-6993)
(cherry picked from commit 4857543a09)

Co-authored-by: Carl Meyer <carl@oddbird.net>
2018-05-19 19:14:42 -04:00
Miss Islington (bot) df4852cbe4 Fix Windows build of Python for latest WinSDK. (GH-6874) (GH-6952)
(cherry picked from commit c0ee341b29)

Co-authored-by: Carl Meyer <carl@oddbird.net>
2018-05-17 15:35:27 -04:00
Miss Islington (bot) d504108a88 bpo-13631: Fix the order of initialization for readline libedit on macOS. (GH-6915) (GH-6928)
The editline emulation needs to be initialized *after* the name is
defined. This fixes the long open issue.
(cherry picked from commit c2f082e9d1)

Co-authored-by: Zvezdan Petkovic <zpetkovic@acm.org>
2018-05-17 03:27:33 -04:00
Miss Islington (bot) e2db6ad1d9 [3.7] bpo-32257: Add ssl.OP_NO_RENEGOTIATION (GH-5904) (#6877)
The ssl module now contains OP_NO_RENEGOTIATION constant, available with
OpenSSL 1.1.0h or 1.1.1.

Note, OpenSSL 1.1.0h hasn't been released yet.

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 67c4801663)

Co-authored-by: Christian Heimes <christian@python.org>
2018-05-16 10:26:19 -04:00
Eric Snow 6bd0c476c5
bpo-32604: Remove xid registry. (#6813)
Remove the interpreters testing helper (and xid registry).
2018-05-15 09:56:18 -04:00
Miss Islington (bot) 2ce72e243f
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:40:27 -07:00
Miss Islington (bot) 3b26e8cab7
Fixed an unused variable warning introduced in GH-6800 (GH-6816)
(cherry picked from commit 00717a46a1)

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
2018-05-14 16:42:30 -07:00
Pablo Galindo 8e633a4035 bpo-20104: Remove posix_spawn from 3.7 (GH-6794)
Remove os.posix_spawn, the API isn't complete and we're still figuring out how it should look. wait for 3.8.
2018-05-14 17:52:43 -04:00
Miss Islington (bot) 67d1968a41 Remove `ifdef` check for an OpenSSL version (0.9.6) we don't support (GH-6807)
(cherry picked from commit f04224210d)

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
2018-05-14 13:45:45 -04:00
Miss Islington (bot) 77fa7835da
bpo-20104: Improve error handling and fix a reference leak in os.posix_spawn(). (GH-6332)
(cherry picked from commit ef347535f2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-05-01 07:18:44 -07:00
Miss Islington (bot) ee95feb69d [3.7] bpo-33383: Fix crash in get() of the dbm.ndbm database object. (GH-6630) (GH-6631)
(cherry picked from commit 2e38cc3933)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-04-29 14:50:26 +03:00
Miss Islington (bot) 75a3e3d5bc bpo-33329: Fix multiprocessing regression on newer glibcs (GH-6575) (GH-6579)
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)

Co-authored-by: Antoine Pitrou <pitrou@free.fr>
2018-04-23 21:42:26 +02:00
Miss Islington (bot) 18cd82815b
bpo-32232: by default, Setup modules are no longer built with -DPy_BUILD_CORE (GH-6489)
Setup modules are no longer built with -DPy_BUILD_CORE by default,
as using that flag may now require including additional internal-only header files.

Instead, only the modules that specifically need it use that setting.
(cherry picked from commit 063db62aab)

Co-authored-by: xdegaye <xdegaye@gmail.com>
2018-04-20 08:39:18 -07:00
Miss Islington (bot) b27c71cdc0
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:10:36 -07:00
Miss Islington (bot) 9bb8cebdce
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:00:57 -07:00
Miss Islington (bot) 74735e2a40 bpo-33209: End framing at the end of C implementation of pickle.Pickler.dump(). (GH-6366)
(cherry picked from commit c869529ea9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-04-03 14:35:11 -07:00
Serhiy Storchaka fd93666c8a
[3.7] Fix duplicating words words. (GH-6296) (GH-6297)
Most of them have been added in 3.7.
(cherry picked from commit bac2d5ba30)
2018-03-28 23:05:24 +03:00
Miss Islington (bot) 05455637f3
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:14:09 -07:00
Miss Islington (bot) 00765bb6ae
Fix error message in sqlite connection thread check. (GH-6028)
(cherry picked from commit 030345c0bf)

Co-authored-by: Takuya Akiba <469803+iwiwi@users.noreply.github.com>
2018-03-26 09:01:22 -07:00
Miss Islington (bot) 2dd885eaa0 [3.7] bpo-33136: Harden ssl module against CVE-2018-8970 (GH-6229) (GH-6230)
Harden ssl module against LibreSSL CVE-2018-8970.
X509_VERIFY_PARAM_set1_host() is called with an explicit namelen. A new test
ensures that NULL bytes are not allowed.

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit d02ac25ab0)

Co-authored-by: Christian Heimes <christian@python.org>
2018-03-25 13:28:20 +02:00
Miss Islington (bot) 42bd62bc87 [3.7] bpo-33127: Compatibility patch for LibreSSL 2.7.0 (GH-6210) (GH-6213)
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:37:54 +01:00
Miss Islington (bot) c71edab15d
bpo-32999: ast: Convert useless check to assert (GH-6197)
(cherry picked from commit c65bf3fe4a)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
2018-03-23 02:43:11 -07:00
Miss Islington (bot) 5d8bb5d07b bpo-32999: Revert GH-6002 (fc7df0e6) (GH-6189) (GH-6190)
bpo-33018 (GH-5944) fixed bpo-32999 too.  So fc7df0e6 is not required
anymore.  Revert it except test case.
(cherry picked from commit f757b72b25)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
2018-03-22 14:00:11 +00:00
Miss Islington (bot) 346964ba05
bpo-33018: Improve issubclass() error checking and message. (GH-5944)
This improves error message for situations when a non-class is
checked w.r.t. an abstract base class.
(cherry picked from commit 40472dd42d)

Co-authored-by: jab <jab@users.noreply.github.com>
2018-03-22 04:49:26 -07:00
Miss Islington (bot) 56f530ef8a
Fix typos in mmap() error messages (GH-6173)
(cherry picked from commit 9308dea3e1)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-03-20 23:24:41 -07:00
Miss Islington (bot) 56cce1ca84 [3.7] bpo-33021: Release the GIL during fstat() calls (GH-6019) (GH-6159)
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:16:30 +01:00
Miss Islington (bot) 429ca448d2 bpo-27645: Fix version number in 'database in transaction' fallback (GH-6131)
It was actually fixed in SQLite 3.8.8, not 3.8.7.

(cherry picked from commit bbf7bb7a63)

Co-authored-by: Aviv Palivoda <palaviv@gmail.com>
2018-03-18 09:24:33 +03:00
Miss Islington (bot) 136905fffd
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:03:56 -07:00
Miss Islington (bot) e8a5a92037 bpo-27645: Add support for native backup facility of SQLite (GH-4238)
(cherry picked from commit d7aed4102d)

Co-authored-by: Emanuele Gaifas <lelegaifax@gmail.com>
2018-03-11 01:29:19 +03:00
Miss Islington (bot) 8c163bbf37
bpo-33016: Fix potential use of uninitialized memory in nt._getfinalpathname (GH-6010)
(cherry picked from commit 3b20d3454e)

Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
2018-03-08 08:26:43 -08:00
Miss Islington (bot) d824b4e4af
bpo-32999: Fix ABC.__subclasscheck__ crash (GH-6002)
(cherry picked from commit fc7df0e664)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
2018-03-06 23:47:40 -08:00
Miss Islington (bot) c4d77a6611
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:26:19 -08:00
Miss Islington (bot) 96fdbacb77
bpo-33001: Prevent buffer overrun in os.symlink (GH-5989)
(cherry picked from commit 6921e73e33)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2018-03-05 15:12:56 -08:00
Miss Islington (bot) 6ae75d9d12 bpo-32903: Fix a memory leak in os.chdir() on Windows (GH-5801) (#5945)
(cherry picked from commit 3e197c7a67)

Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
2018-03-01 18:28:41 +08:00
Miss Islington (bot) 4c842b0920
bpo-31453: Add setter for min/max protocol version (GH-5259)
OpenSSL 1.1 has introduced a new API to set the minimum and maximum
supported protocol version. The API is easier to use than the old
OP_NO_TLS1 option flags, too.

Since OpenSSL has no call to set minimum version to highest supported,
the implementation emulate maximum_version = MINIMUM_SUPPORTED and
minimum_version = MAXIMUM_SUPPORTED by figuring out the minumum and
maximum supported version at compile time.

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 698dde16f6)

Co-authored-by: Christian Heimes <christian@python.org>
2018-02-27 03:41:04 -08:00
Miss Islington (bot) 2614ed4c6e
bpo-32947: OpenSSL 1.1.1-pre1 / TLS 1.3 fixes (GH-5663)
* bpo-32947: OpenSSL 1.1.1-pre1 / TLS 1.3 fixes

Misc fixes and workarounds for compatibility with OpenSSL 1.1.1-pre1 and
TLS 1.3 support. With OpenSSL 1.1.1, Python negotiates TLS 1.3 by
default. Some test cases only apply to TLS 1.2. Other tests currently
fail because the threaded or async test servers stop after failure.

I'm going to address these issues when OpenSSL 1.1.1 reaches beta.

OpenSSL 1.1.1 has added a new option OP_ENABLE_MIDDLEBOX_COMPAT for TLS
1.3. The feature is enabled by default for maximum compatibility with
broken middle boxes. Users should be able to disable the hack and CPython's test suite needs
it to verify default options.

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 05d9fe32a1)

Co-authored-by: Christian Heimes <christian@python.org>
2018-02-27 00:17:49 -08:00
Miss Islington (bot) 53d3f8a899
bpo-32394: Remove some TCP options on old version Windows. (GH-5523)
(cherry picked from commit 19e7d48ce8)

Co-authored-by: animalize <animalize@users.noreply.github.com>
2018-02-26 10:36:17 -08:00
Miss Islington (bot) a9e0b070b3
bpo-32922: dbm.open() now encodes filename with the filesystem encoding. (GH-5832)
(cherry picked from commit 6f600ff173)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-02-26 06:25:40 -08:00
Miss Islington (bot) 632c1cb571
bpo-32622: Native sendfile on windows (GH-5565)
* Support sendfile on Windows Proactor event loop naively.
(cherry picked from commit a19fb3c6aa)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2018-02-25 09:10:58 -08:00