Commit Graph

6400 Commits

Author SHA1 Message Date
Serhiy Storchaka 787826c931 [2.7] bpo-30746: Prohibited the '=' character in environment variable names (GH-2382) (#2393)
in `os.putenv()` and `os.spawn*()`..
(cherry picked from commit 77703942c5)
2017-06-25 09:50:00 +03:00
Serhiy Storchaka 9dda2caca8 [2.7] bpo-30730: Prevent environment variables injection in subprocess on Windows. (GH-2325) (#2372)
Prevent passing other invalid environment variables and command arguments..
(cherry picked from commit d174d24a5d)
2017-06-24 11:49:00 +03:00
Victor Stinner 2ada64d2a0 [2.7] bpo-30694: Upgrade Modules/expat/ to libexpat 2.2.1 (#2300) (#2312)
* bpo-30694: Upgrade Modules/expat/ to libexpat 2.2.1 (#2300)

New file: Modules/expat/siphash.h.
(cherry picked from commit 5ff7132313)

* siphash.h: Address lack of stdint.h for Visual Studio 2003-2008

(cherry picked from libexpat commit c74d380b8f0b5215153d840d2af9455d9c53b960)
2017-06-21 17:12:46 +02:00
Victor Stinner 0e4571a68a bpo-29591: Upgrade Modules/expat to libexpat 2.2 (#2164) (#2202)
* 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:35 +02:00
Victor Stinner bdd3567ccc _tkinter: Fix refleak in getint() (#2153)
PyNumber_Int() creates a new reference: need to decrement result
reference counter.
2017-06-13 11:12:01 +02:00
Stéphane Wirtel 41af942e57 bpo-30615: Fix the leak reference in Modules/_elementtree.c (#2129) 2017-06-12 15:30:48 +02:00
Serhiy Storchaka 0cc43df05e [2.7] bpo-28994: Fixed errors handling in atexit._run_exitfuncs(). (GH-2034) (#2123)
The traceback no longer displayed for SystemExit raised in a callback registered by atexit..
(cherry picked from commit 3fd54d4a7e)
2017-06-12 09:10:53 +03:00
Stéphane Wirtel 28288bebaf bpo-30614: testInitNonExistentFile() of test_bz2 leaks references (#2033)
* bpo-30614: testInitNonExistentFile() of test_bz2 leaks references

Extract the code of BZ2File_dealloc and create a new BZ2File_clear()
function. Call BZ2File_clear() in BZ2File_dealloc().

Define BZ2File_clear() as tp_clear.

Move the lock initialization before the "self->file =
PyObject_CallFunction" in BZ2File_init() and check the lock is not
created twice.

Call BZ2File_clear() in BZ2File_init() after the init of the lock

Co-Authored-By: Victor Stinner <victor.stinner@gmail.com>

* Create bz2module.c

Fix after the review of Victor Stinner
2017-06-10 14:36:57 +02:00
Mariatta 1626a479e2 [2.7] bpo-29960 _random.Random corrupted on exception in setstate(). … (#1289)
(cherry picked from commit 9616a82e78)
2017-05-27 07:19:55 -07:00
Xiang Zhang 6e1b832a6c bpo-30003: Fix handling escape characters in HZ codec (#1720) (#1556) 2017-05-23 01:04:27 +08:00
Serhiy Storchaka 955b6760cf [2.7] bpo-30363: Backport warnings in the re module. (#1577)
Running Python with the -3 option now warns about regular expression
syntax that is invalid or has different semantic in Python 3
or will change the behavior in future Python versions.
2017-05-18 12:34:40 +03:00
Serhiy Storchaka 09b52471f3 bpo-30365: Backport warnings and fix bugs in ElementTree. (#1581)
Running Python with the -3 option now emits deprecation warnings for
getchildren() and getiterator() methods of the Element class in the
xml.etree.cElementTree module and when pass the html argument to
xml.etree.ElementTree.XMLParser().

Fixed a deprecation warning about the doctype() method of the
xml.etree.ElementTree.XMLParser class.  Now it is emitted only when
define the doctype() method in the subclass of XMLParser.

Fixed a bug in the test_bug_200708_close test method.  An EchoTarget
instance was incorrectly passed to XMLParser() as the html argument and
silently ignored.

Tests no longer failed when use the -m option for running only selected
test methods. Checking warnings now is more specific, warnings are
expected only when use deprecated features.
2017-05-17 10:08:11 +03:00
Xiang Zhang 982a17e02d bpo-30242: resolve some undefined behaviours in struct (#1418) (#1588) 2017-05-15 13:17:54 +08:00
Zachary Ware f6c6d1e230 bpo-11681: Document the `-b` and `-bb` options (GH-1562) 2017-05-13 09:30:20 -05:00
Victor Stinner d2aff60719 [2.7] bpo-30283: Backport test_regrtest from master to 2.7 (#1513)
* bpo-30283: regrtest: add --testdir option

* bpo-30283: Backport _testcapi.raise_signal()

Function used by test_regrtest to simulate an interrupted unit test.

* bpo-30283: Backport test_regrtest from master
2017-05-09 13:57:20 +02:00
Xiang Zhang 4e7457b853 bpo-29990: Fix range checking in GB18030 decoder (#1509) 2017-05-09 12:18:56 +08:00
Serhiy Storchaka 5d7a18f3b6 [2.7] bpo-30243: Fixed the possibility of a crash in _json. (GH-1420) (#1471)
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 11:21:45 +03:00
Victor Stinner 2c27731901 bpo-30257: _bsddb: Fix newDBObject() (#1428)
Don't set cursorSetReturnsNone to DEFAULT_CURSOR_SET_RETURNS_NONE
anymore if self->myenvobj is set.

Fix a GCC warning on the strange indentation.
2017-05-03 18:04:18 +02:00
Victor Stinner 2c7085fd7b bpo-27593: Get SCM build info from git instead of hg (#1327)
Based on commit 5c4b0d063a by Ned
Deily, which is based on original patches by Brett Cannon and Steve
Dower.

Remove also the private _Py_svnversion() function and SVNVERSION
variable.

Note: Py_SubversionRevision() and Py_SubversionShortBranch() are
unchanged, they are part of the public API.
2017-05-02 16:55:50 +02:00
Serhiy Storchaka 2a1bf0633c [2.7] [3.5] bpo-30070: Fixed leaks and crashes in errors handling in the parser module. (GH-1131). (GH-1185) (#1189)
(cherry picked from commit a79f4c2195).
(cherry picked from commit 952a05e4e2)
2017-04-20 00:48:57 +03:00
Serhiy Storchaka 64aa4df850 [2.7] bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() (GH-1096) (GH-1180) (#1183)
raised an error.

(cherry picked from commit bf623ae884)
(cherry picked from commit 680fea4)
2017-04-19 22:34:58 +03:00
Serhiy Storchaka 5e79321742 bpo-30074: Fix compile warnings of _PySlice_Unpack and convert missed (#1154)
PySlice_GetIndicesEx in _ctypes.c.
2017-04-15 20:11:12 +03:00
Xiang Zhang 5fbdfc36f3 bpo-30068: add missing iter(self) in _io._IOBase.readlines when hint is present (#1152) 2017-04-15 13:18:22 +08:00
Mariatta b2b00e039c [2.7] bpo-29738: Fix memory leak in _get_crl_dp (GH-526) (GH-1144)
* 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:24:22 -07:00
Serhiy Storchaka e41390aca5 bpo-27867: Expand the PySlice_GetIndicesEx macro. (#1023) (#1046)
(cherry picked from commit b879fe8)
2017-04-08 11:48:57 +03:00
Serhiy Storchaka 9c2c42c221 bpo-27863: Fixed multiple crashes in ElementTree. (#765) (#903) (#963)
(cherry picked from commit 576def096e)

(cherry picked from commit a6b4e19022)
2017-04-02 20:37:03 +03:00
T. Wouters d694a06206 bpo-29942: Fix the use of recursion in itertools.chain.from_iterable. (#913)
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:49:22 -07:00
Xiang Zhang 9c0408d9b6 bpo-29876: fix DECREF for NULL value in subelement() (GH-760) 2017-03-22 14:32:52 +08:00
Xiang Zhang e6a55dd839 bpo-29874: fix INCREF for possible NULL values in select_select() (GH-758) 2017-03-22 12:46:14 +08:00
Xiang Zhang 827c78326a bpo-29873: fix INCREF for possible NULL value in element_getattr() (GH-757) 2017-03-22 12:25:51 +08:00
Serhiy Storchaka 1aa1803b3d bpo-27880: Fixed integer overflow in cPickle when pickle large strings or (#662)
too many objects.
2017-03-14 07:29:33 +02:00
Serhiy Storchaka 0c2ed76fda [2.7] bpo-29768: Fixed compile-time check for expat version. (#577)
(cherry picked from commit 22e707fa04)
2017-03-09 10:52:50 +02:00
svelankar de1c7d5252 Issue #29682:Possible missing NULL check in pyexpat (#573) 2017-03-09 07:27:48 +02:00
Donald Stufft f1a696efd6 bpo-29697: Don't use OpenSSL <1.0.2 fallback on 1.1+ (GH-399) 2017-03-02 12:37:07 -05:00
INADA Naoki 0f48ecddfb Update URL of Mersenne Twister Home Page (GH-116) 2017-02-16 01:00:54 +09:00
doko@ubuntu.com dbbc9d37a9 update zlib ChangeLog file 2017-01-31 13:56:50 +01:00
doko@ubuntu.com 80b24a9354 - Issue #29169: Update zlib to 1.2.11. 2017-01-31 13:30:58 +01:00
Benjamin Peterson 9ce1564cd9 revert dd13098a5dc2 (#29006, #10513) 2017-01-16 00:07:27 -08:00
Benjamin Peterson ebcf338a69 generate spaces instead of tabs into config.c 2017-01-16 00:05:12 -08:00
Benjamin Peterson 888a29fedb fix _testcapi to work when statically linked into python 2017-01-15 23:57:56 -08:00
Martin Panter c7496ee6da Fix spelling and markup in documentation and code comment
* Mark up ``--help`` to avoid generating an en dash
* Use forward slash in Unix command line with a dollar sign ($) prompt
2017-01-14 08:51:49 +00:00
Serhiy Storchaka 99ba17f553 Issue #29082: Fixed loading libraries in ctypes by unicode names on Windows.
Original patch by Chi Hsuan Yen.
2017-01-12 17:00:32 +02:00
Benjamin Peterson c8a752eaff merge heads 2017-01-11 23:40:23 -08:00
Benjamin Peterson 0897a557f4 revert 030e100f048a (#29006, #10513) 2017-01-11 23:39:58 -08:00
doko@ubuntu.com 54dc428657 - Issue #29169: Update zlib to 1.2.10. 2017-01-05 17:26:35 +01:00
Steve Dower f85dbfc3d2 Issue #28768: Fix implicit declaration of function _setmode. Patch by Masayuki Yamamoto 2016-12-28 15:41:09 -08:00
Serhiy Storchaka f04790a4b7 Fixed possible reference leaks in the _json module. 2017-01-03 11:17:53 +02:00
Serhiy Storchaka 1451874e6b Backed out changeset 78bf34b6a713 2016-12-28 09:23:17 +02:00
Antoine Pitrou f939b3c0f7 Issue #28427: old keys should not remove new values from
WeakValueDictionary when collecting from another thread.
2016-12-27 15:08:27 +01:00
Serhiy Storchaka 994f04dbf5 Issue #28998: More APIs now support longs as well as ints. 2016-12-27 15:09:36 +02:00
Martin Panter 3698bd262f Issue #29004: Document binascii.crc_hqx() implements CRC-CCITT 2016-12-24 07:53:57 +00:00
Serhiy Storchaka 85add4783e Issue #28871: Fixed a crash when deallocate deep ElementTree.
Fixed running MiscTests in test_xml_etree_c.
2016-12-21 12:55:28 +02:00
Serhiy Storchaka 6560e22c66 Issue #28925: cPickle now correctly propagates errors when unpickle instances
of old-style classes.
2016-12-15 12:51:34 +02:00
Benjamin Peterson 9ea8fafd6a fix function name 2016-12-03 13:07:47 -08:00
Benjamin Peterson e95048e8bb also do not leak the mode string if creating the file fails 2016-12-03 13:05:40 -08:00
Benjamin Peterson d3035d5d3d do not leak the FILE * pointer in error cases of fdopen() 2016-12-03 13:03:18 -08:00
Benjamin Peterson 5726b6316b inline constant into its single use 2016-12-03 12:32:38 -08:00
Benjamin Peterson 26c985a8aa fix refleak in null-containing error case (#21147) 2016-12-03 12:01:32 -08:00
Benjamin Peterson d7324bcf29 when you enter repr, you must leave, too (#25455) 2016-12-03 11:30:04 -08:00
Benjamin Peterson ada7d92917 fix refleak in file handle creation error case 2016-12-03 11:12:51 -08:00
Martin Panter fd08fdc7be Issue #25659: Change assert to TypeError in from_buffer/_copy()
Based on suggestion by Eryk Sun.
2016-11-20 09:35:06 +00:00
Martin Panter f75a2ebbac Issue #10656: Fix out-of-tree building on AIX
The ld_so_aix script and python.exp file are created in the build directory.
Patch by Tristan Carel and Michael Haubenwallner.
2016-11-20 09:31:41 +00:00
Martin Panter 2167666658 Issue #28000: Fix gethostbyname_r() usage on AIX with _LINUX_SOURCE_COMPAT
Patch by Matthieu S.
2016-11-14 04:13:55 +00:00
Serhiy Storchaka 1e4b73fcf7 Issue #19398: Extra slash no longer added to sys.path components in case of
empty compile-time PYTHONPATH components.  This fixes some tests in -S or -I
modes.
2016-11-11 12:11:55 +02:00
Serhiy Storchaka 52b0888dbd Issue #28387: Fixed possible crash in _io.TextIOWrapper deallocator when
the garbage collector is invoked in other thread.
Based on patch by Sebastian Cufre.
2016-11-03 15:36:50 +02:00
Serhiy Storchaka 4089b50080 Fixed possible NULL decrefing. 2016-10-28 12:14:34 +03:00
Ned Deily 0436cebb8f Issue #24381: Avoid unused function warning when building bundled macOS libffi.
Patch by Vajrasky Kok.
2016-10-20 15:41:11 -04:00
Martin Panter 38d335b2a1 Issue #28480: Avoid label at end of compound statement --without-threads 2016-10-20 03:56:48 +00:00
Serhiy Storchaka 6a35bf6ca0 Silenced compiler warnings. 2016-10-08 09:58:08 +03:00
Benjamin Peterson bc4bdbd6a8 make 'where' Py_ssize_t 2016-10-05 23:26:24 -07:00
Benjamin Peterson 1df2cbed76 mmap: do all internal arithmetic with Py_ssize_t while being very careful about overflow 2016-10-05 21:45:48 -07:00
Serhiy Storchaka 5170c16d21 Issue #27897: Fixed possible crash in sqlite3.Connection.create_collation()
if pass invalid string-like object as a name.  Original patch by Xiang Zhang.
2016-10-01 08:24:55 +03:00
Serhiy Storchaka 36beb5ec13 Issue #27963: Fixed possible null pointer dereference in ctypes.set_conversion_mode().
Patch by Xiang Zhang.
2016-09-27 15:24:13 +03:00
Benjamin Peterson aa0342091f be extremely careful about overflows in encode_basestring_ascii (closes #28284) 2016-09-26 23:55:41 -07:00
Martin Panter ca56dd4767 Issue #28139: Fix messed up indentation
Also update the classmethod and staticmethod doc strings and comments to
match the RST documentation.
2016-09-17 07:54:55 +00:00
Martin Panter e8bba99ab6 Issue #28145: Spelling fixes 2016-09-16 00:46:05 +00:00
Martin Panter 5f75502a2e Issue #24366: Fix indentation
Backports changes by Victor Stinner, Hirokazu Yamamoto, li4ick and Benjamin
Peterson.
2016-09-15 01:50:53 +00:00
Serhiy Storchaka 12c8855d09 Issue #27599: Fixed buffer overrun in binascii.b2a_qp() and binascii.a2b_qp(). 2016-09-14 16:36:15 +03:00
Benjamin Peterson e4668aade9 fix misleading indentation (closes #28139) 2016-09-13 21:48:57 -07:00
Martin Panter 6507657ddd Issue #27895: Spelling fixes (Contributed by Ville Skyttä). 2016-09-07 12:03:06 +00:00
Martin Panter 6eec87810f Issue #27570: Avoid zero-length memcpy() calls with null source pointers 2016-09-07 11:04:41 +00:00
Christian Heimes 6663eb6b72 Issue #27691: Fix ssl module's parsing of GEN_RID subject alternative name fields in X.509 certs. 2016-09-06 23:25:35 +02:00
Benjamin Peterson f0039d1f8d fix unused variable warnings in pysqlite (closes #27967) 2016-09-06 10:01:16 -07:00
Benjamin Peterson 28e2771f24 Backed out changeset 8b6be1341770 2016-09-05 17:22:09 -07:00
Benjamin Peterson bbc8fe1841 remove long double from ctypes value union
It is unused. It also forces a 16-byte alignment, which creates problems because
Python's allocator only uses 8-byte alignment.
2016-09-05 16:24:52 -07:00
Christian Heimes 9940633e89 Issue #26470: Use short name rather than name for compression name to fix #27958. 2016-09-06 01:10:39 +02:00
Christian Heimes c2fc7c4f53 Issue #26470: Port ssl and hashlib module to OpenSSL 1.1.0. 2016-09-05 23:37:13 +02:00
Benjamin Peterson f859d0d7fd move declaration to top of the function to appease the c89 gods 2016-09-05 13:07:48 -07:00
Benjamin Peterson aa187c6878 rewrite unpack_add_info, so it has less memory corruption bugs (closes #27944) 2016-09-05 12:44:38 -07:00
Mark Dickinson e6239a3ab3 Issue #27934: Use float.__repr__ instead of plain repr when JSON-encoding an instance of a float subclass. Thanks Eddie James. 2016-09-03 17:45:00 +01:00
Serhiy Storchaka e63af905a4 Issue #27861: Fixed a crash in sqlite3.Connection.cursor() when a factory
creates not a cursor.  Patch by Xiang Zhang.
2016-08-29 14:29:55 +03:00
Martin Panter eac40fdf72 Issue #19884: Avoid spurious output on OS X with Gnu Readline
Also adjust the test condition, because enable-meta-key was only added in
6.1, not 6.0.
2016-08-27 02:54:43 +00:00
Berker Peksag dc60c75aee Issue #10513: Fix a regression in Connection.commit()
Statements should not be reset after a commit.

Backported from 029050896b
2016-08-26 22:19:05 +03:00
Benjamin Peterson aed5a4ee73 rearrange methodcaller_new so that the main error case does not cause uninitialized memory usage (closes #27783) 2016-08-16 23:35:35 -07:00
Benjamin Peterson 0f3596a136 do not decref value borrowed from list (closes #27774) 2016-08-15 22:01:41 -07:00
Benjamin Peterson 505989c0e7 fail when negative values are passed to instr() 2016-08-15 21:40:14 -07:00
Benjamin Peterson 6c08d9628a fix possible integer overflow in binascii.b2a_qp (closes #27760)
Reported by Thomas E. Hybel
2016-08-13 18:33:33 -07:00
Benjamin Peterson f670120cb7 do not allow reading negative values with getstr() 2016-08-13 18:15:28 -07:00
Benjamin Peterson d81ad0df71 check for overflow in join_append_data (closes #27758)
Reported by Thomas E. Hybel
2016-08-13 17:17:06 -07:00
Benjamin Peterson 04a5385353 fix possible overflow in encode_basestring_ascii (#23369) 2016-08-13 16:47:25 -07:00
Vinay Sajip e1f3afbde2 Issue #20160: Handled passing of large structs to callbacks correctly. 2016-08-05 21:10:26 +01:00
Martin Panter a850ef698e Issue #27626: Spelling fixes in docs, comments and internal names
Based on patch by Ville Skyttä.
2016-07-28 01:11:04 +00:00
Martin Panter e2eacc02bc Issue #23943: Fix typos. Patch by Piotr Kasprzyk. 2016-07-28 03:04:04 +00:00
Victor Stinner 2e1a34025c ctypes: fix CThunkObject_new()
* Initialize restype and flags fields to fix a crash when Python runs on a
  read-only file system
* Use Py_ssize_t type rather than int for the "i" iterator variable
* Reorder assignements to be able to more easily check if all fields are
  initialized

Issue #11048. Initial patch written by Marcin Bachry.
2016-07-27 16:58:47 +02:00
Martin Panter 1e411c5c78 Issue #27130: Fix handling of buffers exceeding (U)INT_MAX in “zlib” module
Ported from patches by Xiang Zhang, Nadeem Vawda, and myself.
2016-07-23 04:22:09 +00:00
Martin Panter bf2dca96fb English spelling and grammar fixes 2016-07-11 07:51:37 +00:00
Martin Panter b362f75f6e Issue #25523: Correct "a" article to "an" article
This changes the main documentation, doc strings, source code comments, and a
couple error messages in the test suite. In some cases the word was removed
to fix the grammar.
2015-11-02 03:37:02 +00:00
Martin Panter 8c6849bfe6 Issue #23804: Fix SSL zero-length recv() calls to not block and raise EOF 2016-07-11 00:17:13 +00:00
Benjamin Peterson e5fa8b0b0d initialize variable to appease gcc 2016-07-07 00:24:26 -07:00
Benjamin Peterson 42e1029564 assume egd unless OPENSSL_NO_EGD is defined—remove configure check (closes #24557) 2016-07-07 00:02:31 -07:00
Serhiy Storchaka 3c9ce74c21 Issue #23908: os functions, open() and the io.FileIO constructor now reject
unicode paths with embedded null character on Windows instead of silently
truncate them.
2016-07-01 23:34:44 +03:00
Serhiy Storchaka ff0d875ad1 array.buffer_info() should return a length as int, not long, for compatibility. 2016-06-24 08:38:59 +03:00
Serhiy Storchaka 0cc5a2b263 Fixed integer overflow and handled MemoryError in array.buffer_info(). 2016-06-24 00:00:32 +03:00
Martin Panter b3eaaf0bfc Issue #22463: Cure unused function warnings on AIX 2016-06-22 02:46:33 +00:00
Martin Panter 2924124259 Issue #22463: Correct #endif placement; patch by Senthil Kumaran 2016-06-22 02:04:38 +00:00
Martin Panter 646b528467 Issue #22463: Backport compiler warning fixes and workarounds
* Set but unused variable in Parser/pgen.c in non-debug builds. Patch by
  Christian Heimes.
* Unused static function in Modules/readline.c. Patch by Georg Brandl.
* main_window unused in Modules/tkappinit.c. Patch by Gregory P. Smith.
* Dead assignment in Modules/_ctypes/cfield.c. Extracted from patch by Brett
  Cannon.
* Expression result unused in PyObject_INIT macro expansions. Based on
  patches by Christian Heimes.
* Load expat_config.h and therefore pyconfig.h before C stdlib headers are
  loaded. This silences pre-processor warnings including '_POSIX_C_SOURCE
  redefined'. Extracted from patch by Christian Heimes.
2016-06-21 23:58:05 +00:00
Martin Panter 4e6e565368 Fix English spelling and grammar errors 2016-06-20 07:52:50 +00:00
Serhiy Storchaka f46d3afc51 ctypes: the type of b_size is Py_ssize_t. 2016-06-17 11:11:07 +03:00
Serhiy Storchaka ef012cc7f7 Issue #27330: Fixed possible leaks in the ctypes module. 2016-06-16 22:08:11 +03:00
Serhiy Storchaka 1f7586eeb9 Issue #25455: Fixed a crash in repr of cElementTree.Element with recursive tag. 2016-06-12 10:06:32 +03:00
Benjamin Peterson d244a8f7cb upgrade expt to 2.1.1 (closes #26556) 2016-06-11 13:28:56 -07:00
Martin Panter c9813d83f7 Issue #20699: Document that “io” methods should accept memoryview
This matches the usage by BufferedReader, BufferedWriter, etc. Also document
and test that the write() methods should only access their argument before
they return.
2016-06-03 05:59:20 +00:00
Benjamin Peterson b3e073cbb3 fix leak of keyfile_bytes 2016-06-08 23:18:51 -07:00
Benjamin Peterson 3b91de5a76 stop leaking certfile_bytes (closes #27267) 2016-06-08 23:16:36 -07:00
Benjamin Peterson a48aa85da0 check the result of PyByteArray_Resize in readline() (closes #27211) 2016-06-03 22:20:44 -07:00
Benjamin Peterson e725777eaf remove (hilarious) defaults for various constants getpath.c needs 2016-06-02 12:41:35 -07:00
Martin Panter 8d496add74 Issue #27171: Fix typos in documentation, code comments, and tests 2016-06-02 10:35:44 +00:00
Martin Panter 200a615774 Issue #27125: Remove duplicated words from documentation and comments 2016-05-30 04:04:50 +00:00
Martin Panter 9c946bbf20 Issue #5784: Expand documentation and tests for zlib wbits parameter
Based on documentation by AM Kuchling.
2016-05-27 07:32:11 +00:00
Martin Panter b1d867f149 Issue #27076: Doc, comment and test function name spelling fixes
Most fixes to Doc/ and Lib/ directories by Ville Skyttä.
2016-05-26 05:28:50 +00:00
Benjamin Peterson 59dd0e64ad fix indentation and add curlies (closes #27093) 2016-05-23 22:47:50 -07:00
Serhiy Storchaka 12cf60c7fa Issue #26168: Fixed possible refleaks in failing Py_BuildValue() with the "N"
format unit.
2016-05-20 22:31:24 +03:00
Serhiy Storchaka d0dc72b497 Issue #26995: Added tests for "f", "d", "D", "S", "Y", and "U" format codes
in PyArg_ParseTuple().
2016-05-16 10:12:02 +03:00
Serhiy Storchaka c6a7c96a8f Backported tests for issue #18531. 2016-05-16 09:55:32 +03:00
Martin Panter f45c1755c3 Remove PEP 291 compatibility requirements for ctypes and modulefinder
https://mail.python.org/pipermail/python-dev/2016-May/144502.html
2016-05-14 07:25:37 +00:00
Serhiy Storchaka 22d8942b8d Issue #25745: Fixed leaking a userptr in curses panel destructor. 2016-05-09 00:11:59 +03:00
Martin Panter 4f23cabc16 Corrections for a/an in code comments and documentation 2016-05-08 13:45:55 +00:00
Serhiy Storchaka 4ef4edaa9f Issue #26822: Decreased an overhead of using _PyArg_NoKeywords() in calls of
itemgetter, attrgetter and methodcaller objects.
2016-04-29 09:12:38 +03:00
Serhiy Storchaka 0207e7699b Issue #26822: itemgetter, attrgetter and methodcaller objects no longer
silently ignore keyword arguments.
2016-04-23 10:53:28 +03:00
Martin Panter 5b48fa9fa4 Fix spelling (inital), grammar (may translates) in documentation, comments 2016-04-19 04:03:41 +00:00
Serhiy Storchaka 9a118f1dc3 Issue #26778: Fixed "a/an/and" typos in code comment and documentation. 2016-04-17 09:37:36 +03:00
Martin Panter bf02d18844 Fix typos in code comment and documentation 2016-04-16 09:28:57 +00:00
Martin Panter 6a8163a928 Correct “an” → “a” with “Unicode”, “user”, “UTF”, etc
This affects documentation and code comments.
2016-04-15 02:14:19 +00:00
Serhiy Storchaka bb650631f2 Issue #26200: Restored more safe usages of Py_SETREF. 2016-04-11 09:53:37 +03:00
Serhiy Storchaka 763a61ca95 Issue #26200: Added Py_SETREF and replaced Py_XSETREF with Py_SETREF
in places where Py_DECREF was used.
2016-04-10 18:05:12 +03:00
Serhiy Storchaka bc62af1bbe Issue #22570: Renamed Py_SETREF to Py_XSETREF. 2016-04-06 09:51:18 +03:00
Martin Panter aad86a6015 Issue #6953: Rearrange and expand Readline module documentation
* Group functions into six new subsections
* Document the underlying Readline function or variable accessed
* get_history_length() returns the history file limit
* clear_history() is conditionally compiled in
* Clarify zero and one bases for history item indexes
* parse_and_bind() uses its argument directly as an init line
* Change "command line" to "line buffer" for consistency
* read_init_file() also executes the file
* read_history_file() replaces the previous history
* write_history_file() overwrites any existing file
* Differentiate history file lines from history list items, which could be
  multi-line
* Add more information about completion, also addressing Issue #10796
* libedit (Editline) may be used on any platform; detection is OS X specific
2016-04-05 07:37:22 +00:00
Martin Panter ed06e8fa50 Issue #23735: Avoid sighandler_t Gnu-ism 2016-04-03 08:00:49 +00:00
Martin Panter a70c3239a7 Issue #23735: Add SIGWINCH handler for Readline 6.3+ support, by Eric Price 2016-04-03 02:54:58 +00:00
Martin Panter b8089b4dde Issue #26644: Raise ValueError for negative SSLSocket.recv() and read() 2016-03-27 05:35:19 +00:00
Martin Panter b7036114fe Issue #24266: Cancel history search mode with Ctrl+C in Readline 7 2016-03-22 07:24:05 +00:00
Ned Deily 69d7f6a6a7 Issue #26505: Fix typos in getaddrinfo license text.
Patch by Alex Willmer.
2016-03-07 14:51:19 -05:00
Ned Deily 3058eb418a Issue #26406: Avoid unnecessary serialization of getaddrinfo(3) calls on
current versions of OpenBSD and NetBSD.  Patch by A. Jesse Jiryu Davis.
2016-02-23 22:03:39 +11:00
Benjamin Peterson b2e3946d76 open the cert store readonly
Patch from Chi Hsuan Yen.
2016-02-17 22:13:19 -08:00
Ned Deily 1c2a7b5939 Issue #25924: Avoid unnecessary serialization of getaddrinfo(3) calls on OS X
versions 10.5 or higher.  Original patch by A. Jesse Jiryu Davis.
2016-02-15 16:51:24 +11:00
Charles-François Natali 674a3cd20b Issue #24303: Fix random EEXIST upon multiprocessing semaphores creation with
Linux PID namespaces enabled.
2016-02-12 22:39:21 +00:00
Martin Panter 53ae0ba6e3 Issue #26304: Change "allows to <verb>" to "allows <verb>ing" or similar
The original form is incorrect grammar and feels awkward, even though the
meaning is clear.
2016-02-10 05:44:01 +00:00
Serhiy Storchaka 71b71763c5 Issue #25945: Fixed bugs in functools.partial.
Fixed a crash when unpickle the functools.partial object with wrong state.
Fixed a leak in failed functools.partial constructor.
"args" and "keywords" attributes of functools.partial have now always types
tuple and dict correspondingly.
2016-02-02 18:45:59 +02:00
Martin Panter 1d269c1067 Issue #26244: Clarify default zlib compression level in documentation
Based on patch by Aviv Palivoda.
2016-02-03 07:06:33 +00:00
Serhiy Storchaka 4b40c3e69e Fixed a crash in new tests in test_getargs2 added in 60a2d67dacb3 (issue #26198). 2016-01-29 00:55:37 +02:00
Serhiy Storchaka 13ea0c5d9c Fixed an infinite loop in zipimport caused by cebcd2fd3e1f (issue #19883). 2016-01-29 00:37:28 +02:00
Serhiy Storchaka c4ef384d13 Issue #19883: Fixed possible integer overflows in zipimport. 2016-01-28 21:32:53 +02:00
Serhiy Storchaka 3ecb6ab993 Issue #26198: Added tests for string-related format units of PyArg_Parse*()
functions: "s", "s*", "s#", "t#", "z", "z*", "z#", "w", "w*", "w#", "u",
"u#", "es", "et", "es#", "et#" and "c".
2016-01-28 19:56:04 +02:00
Benjamin Peterson 5640bbb6c5 reject negative data_size 2016-01-21 22:02:46 -08:00
Benjamin Peterson 64ea192b73 prevent buffer overflow in get_data (closes #26171) 2016-01-20 22:23:44 -08:00
Benjamin Peterson e4309f7f14 fix refleak in error condition 2016-01-20 22:06:43 -08:00
Victor Stinner b5a1d7536d Replace fpgetmask() with fedisableexcept()
Issue #24520: On FreeBSD, fpgetmask() was deprecated long time ago.
fedisableexcept() is now preferred.
2016-01-20 22:30:58 +01:00
Brett Cannon c39162de4a Issue #26114: Remove mention of 'Numerical Recipes'. 2016-01-15 09:41:49 -08:00
Benjamin Peterson f30bad284b remove some copyright notices supserseded by the toplevel ones 2016-01-01 11:53:47 -06:00
Serhiy Storchaka 2e6c829681 Issue #20440: More use of Py_SETREF.
This patch is manually crafted and contains changes that couldn't be handled
automatically.
2015-12-27 15:41:58 +02:00
Serhiy Storchaka 8688acaf2e Issue #20440: Applied yet one patch for using Py_SETREF.
The patch is automatically generated, it replaces the code that uses Py_CLEAR.
2015-12-27 12:38:48 +02:00
Serhiy Storchaka 20a003bea4 Issue #24103: Fixed possible use after free in ElementTree.iterparse(). 2015-12-24 11:51:24 +02:00
Serhiy Storchaka 5951f2300f Issue #20440: Massive replacing unsafe attribute setting code with special
macro Py_SETREF.
2015-12-24 10:35:35 +02:00
Serhiy Storchaka c06a6d0958 Issue #25421: __sizeof__ methods of builtin types now use dynamic basic size.
This allows sys.getsize() to work correctly with their subclasses with
__slots__ defined.
2015-12-19 20:07:48 +02:00
Serhiy Storchaka 33ea29772d Fixed possible leaks in ElementTree parser. 2015-12-09 19:44:30 +02:00
Serhiy Storchaka 45cf0b7f3e Issue25814: Propagate all errors from custom XML parser handlers
in ElementTree.iterparse().
2015-12-06 23:51:53 +02:00
Serhiy Storchaka 048e107859 Fixed reference leak when read truncated pickle. 2015-12-01 00:32:49 +02:00
Serhiy Storchaka b5b76c370b Fixed compilation error introduced in 745fd5550bc0. 2015-11-26 11:21:47 +02:00
Serhiy Storchaka c4c64be1b8 Issue #19687: Fixed possible integer overflows in ElementTree.
Based on patch by Christian Heimes.
2015-11-25 20:12:58 +02:00
Serhiy Storchaka 80767a38c7 Issue #25725: Fixed a reference leak in cPickle.loads() when unpickling
invalid data including tuple instructions.
2015-11-25 15:07:49 +02:00
Serhiy Storchaka 5c137669e3 Issue #23914: Fixed SystemError raised by unpickler on broken pickle data. 2015-11-23 15:20:43 +02:00
Serhiy Storchaka a0ae9ff006 Issue #19687: Fixed memory leak on failed Element slice assignment. 2015-11-22 12:31:11 +02:00
Benjamin Peterson 93ed946dd9 rm trailing ws 2015-11-14 15:12:38 -08:00
Benjamin Peterson c591936789 fix possible memory lea k in _get_aia_uri (closes #25578) 2015-11-14 15:12:18 -08:00
Benjamin Peterson b1c1e673cb fix build with older openssl (#25569) 2015-11-14 00:09:22 -08:00
Raymond Hettinger f358d2b244 Second instance of deque needing "len" instead of "Py_SIZE" in Py2.7 2015-11-12 18:20:21 -08:00
Raymond Hettinger 3a75403880 Deque uses "len" instead of varhead in Py2.7 2015-11-12 07:18:45 -08:00
Benjamin Peterson 10aaca9941 always set OP_NO_SSLv3 by default (closes #25530) 2015-11-11 22:38:41 -08:00
Benjamin Peterson 59d451d68f fix memory leak in _get_crl_dp (closes #25569)
Patch started by Stéphane Wirtel.
2015-11-11 22:07:38 -08:00
Serhiy Storchaka da87e45add Issue #892902: Fixed pickling recursive objects. 2015-11-07 11:15:32 +02:00
Serhiy Storchaka c72e66a048 Issue #25523: Backported a-to-an corrections. 2015-11-02 15:06:09 +02:00
Martin Panter dab305ef05 Issue #22413: Document newline effect on StringIO initializer and getvalue
Also add to comment in the C code.
2015-10-10 02:52:30 +00:00
Raymond Hettinger e904427285 Backport early-out 91259f061cfb to reduce the cost of bb1a2944bcb6 2015-10-06 23:12:02 -04:00
Berker Peksag 4e2947728c Issue #25290: Fix typo in csv.reader() docstring
Patch by Johannes Niediek.
2015-10-02 19:30:21 +03:00
Serhiy Storchaka a8041ae565 Issue #25203: Failed readline.set_completer_delims() no longer left the
module in inconsistent state.
2015-09-27 22:34:59 +03:00
Benjamin Peterson 96d2654fc7 fix spacing 2015-09-27 02:13:40 -07:00
Raymond Hettinger d2a4073db2 Issue #25135: Avoid possible reentrancy issues in deque_clear. 2015-09-26 00:52:57 -07:00
Victor Stinner 9a2326b362 Issue #24684: socket.socket.getaddrinfo() now calls
PyUnicode_AsEncodedString() instead of calling the encode() method of the
host, to handle correctly custom unicode string with an encode() method which
doesn't return a byte string. The encoder of the IDNA codec is now called
directly instead of calling the encode() method of the string.
2015-09-11 12:42:13 +02:00
Martin Panter 6f80464f4a Issue #25030: Do not document seek() as if it accepts keyword arguments
Patch from Shiyao Ma.
2015-09-11 03:58:30 +00:00
Gregory P. Smith 0a8572800b Don't left shift negative values. Use an unsigned value instead to avoid
undefined behavior.
2015-08-04 16:29:00 -07:00