9220 Commits

Author SHA1 Message Date
Serhiy Storchaka
99e9eb6111 [3.5] bpo-30746: Prohibited the '=' character in environment variable names (GH-2382) (#2392)
in `os.putenv()` and `os.spawn*()`..
(cherry picked from commit 77703942c5)
2017-06-25 09:49:40 +03:00
Serhiy Storchaka
e0d446e9ca [3.5] bpo-30745: Fix compiler warnings introduced in bpo-30730. (GH-2376) (#2379)
(cherry picked from commit 0ee32c1)
2017-06-24 16:42:44 +03:00
Serhiy Storchaka
a7c0264735 [3.5] bpo-30730: Prevent environment variables injection in subprocess on Windows. (GH-2325) (#2361)
Prevent passing other invalid environment variables and command arguments..
(cherry picked from commit d174d24a5d)
2017-06-23 20:27:02 +03:00
Victor Stinner
91d171be45 bpo-30694: Upgrade Modules/expat/ to libexpat 2.2.1 (#2300) (#2314)
New file: Modules/expat/siphash.h.
(cherry picked from commit 5ff7132313)
2017-06-21 16:05:14 +02:00
Serhiy Storchaka
b39c78a73c [3.5] bpo-30650: Fixed a syntax error: missed right parentheses (GH-2154) (#2216)
(cherry picked from commit 0d32218)
2017-06-15 16:58:15 +03:00
Victor Stinner
8c797ed8a0 bpo-29591: Upgrade Modules/expat to libexpat 2.2 (#2164) (#2201)
* bpo-29591: Upgrade Modules/expat to libexpat 2.2

* bpo-29591: Restore Python changes on expat

* bpo-29591: Remove expat config of unsupported platforms

Remove the configuration (Modules/expat/*config.h) of unsupported
platforms:

* Amiga
* MacOS Classic on PPC32
* Open Watcom

* bpo-29591: Remove useless XML_HAS_SET_HASH_SALT

The XML_HAS_SET_HASH_SALT define of Modules/expat/expat.h became
useless since our local expat copy was upgrade to expat 2.1 (it's now
expat 2.2.0).

(cherry picked from commit 23ec4b57e1)
2017-06-15 02:16:38 +02:00
Serhiy Storchaka
7d8c1ebd86 [3.5] bpo-28994: Fixed errors handling in atexit._run_exitfuncs(). (GH-2034) (#2122)
The traceback no longer displayed for SystemExit raised in a callback registered by atexit.
(cherry picked from commit 3fd54d4a7e)
2017-06-12 09:02:33 +03:00
Zachary Ware
afa6a38960 [3.5] bpo-27425: Be more explicit in .gitattributes (GH-840) (GH-2084)
Also updates checked-in line endings on some files.
2017-06-10 15:40:08 -05:00
Nathaniel J. Smith
54ba41ecc5 [3.5] bpo-30594: Fixed refcounting in newPySSLSocket (GH-1992) (#1993)
If pass a server_hostname= that fails IDNA decoding to SSLContext.wrap_socket or SSLContext.wrap_bio, then the SSLContext object had a spurious Py_DECREF called on it, eventually leading to segfaults.
(cherry picked from commit 65ece7ca23)
2017-06-08 14:14:44 +03:00
Mariatta
440bc4f4b2 [3.5] bpo-29960 _random.Random corrupted on exception in setstate(). … (#1288)
(cherry picked from commit 9616a82e78)
2017-05-27 07:19:40 -07:00
Xiang Zhang
65440f8278 bpo-30003: Fix handling escape characters in HZ codec (#1556) (#1718) 2017-05-23 01:02:33 +08:00
Xiang Zhang
dd2a09cf98 bpo-30242: resolve some undefined behaviours in struct (#1418) (#1587) 2017-05-15 13:17:41 +08:00
Xiang Zhang
f5f7870d93 bpo-29990: Fix range checking in GB18030 decoder (#1495) (#1508)
When decoding a 4-byte GB18030 sequence, the first and third byte cannot exceed 0xFE.
2017-05-09 12:17:09 +08:00
Serhiy Storchaka
ee2294860e [3.5] bpo-30243: Fixed the possibility of a crash in _json. (GH-1420) (#1470)
It was possible to get a core dump by using uninitialized
_json objects. Now __new__ methods create initialized objects.
__init__ methods are removed..
(cherry picked from commit 76a3e51a40)
2017-05-05 10:40:47 +03:00
Serhiy Storchaka
943861f09a [3.5] bpo-30184: Add tests for invalid use of PyArg_ParseTupleAndKeywords. (GH-1316). (#1442)
(cherry picked from commit 5f161fd86d)
2017-05-04 06:50:43 +03:00
Antoine Pitrou
0d9d61828b Backport bpo-30205 to 3.5 (#1404) 2017-05-03 00:22:28 +02:00
Serhiy Storchaka
c97c1914f4 [3.5] bpo-30065: Fixed arguments validation in _posixsubprocess.fork_exec(). (GH-1110) (#1190)
(cherry picked from commit 66bffd1)
2017-04-20 00:51:05 +03:00
Serhiy Storchaka
952a05e4e2 [3.5] bpo-30070: Fixed leaks and crashes in errors handling in the parser module. (GH-1131). (#1185)
(cherry picked from commit a79f4c2195)
2017-04-19 23:44:43 +03:00
Serhiy Storchaka
e63af29c87 [3.5] bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() (GH-1096) (GH-1180) (#1182)
raised an error.

(cherry picked from commit bf623ae884)
(cherry picked from commit 680fea4067)
2017-04-19 22:09:56 +03:00
Xiang Zhang
4f43f87b62 bpo-30068: add missing iter(self) in _io._IOBase.readlines when hint is present (#1130) (#1151) 2017-04-15 13:28:08 +08:00
Mariatta
c40740cf06 [3.5] bpo-29738: Fix memory leak in _get_crl_dp (GH-526) (GH-1143)
* Remove conditional on free of `dps`, since `dps` is now allocated for
all versions of OpenSSL
* Remove call to `x509_check_ca` since it was only used to cache
the `crldp` field of the certificate
CRL_DIST_POINTS_free is available in all supported versions of OpenSSL
(recent 0.9.8+) and LibreSSL.
(cherry picked from commit 2849cc34a8)
2017-04-14 18:36:11 -07:00
Serhiy Storchaka
fa25f16a44 Expand the PySlice_GetIndicesEx macro. (#1023) (#1045)
(cherry picked from commit b879fe82e7)
2017-04-08 11:18:30 +03:00
Vinay Sajip
ae0915e42d Closes bpo-29939: suppress compiler warnings in _ctypes_test (#1039)
Changed test code to suppress a compiler warning, while taking care to avoid the code being optimized out by the compiler.
(cherry picked from commit 164d30eb1e)
2017-04-07 23:24:51 +01:00
T. Wouters
9273dfe180 bpo-29942: Fix the use of recursion in itertools.chain.from_iterable. (#912)
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.
(cherry picked from commit 5466d4af5f)
2017-03-30 12:48:55 -07:00
Serhiy Storchaka
8b8bde44f3 bpo-29935: Fixed error messages in the index() method of tuple, list and deque (#887) (#907) (#909)
when pass indices of wrong type.
(cherry picked from commit d4edfc9abf)
(cherry picked from commit bf4bb2e430)
2017-03-30 20:31:46 +03:00