Subject | Hash | Author | Date (UTC) |
---|---|---|---|
bpo-30281: Fix the default value for stop in PySlice_Unpack() (#1480) | 2ddf5a19c3a06978edff2c8ba0aaf5df3528204a | Xiang Zhang | 2017-05-10 10:19:41 |
bpo-30298: Weaken the condition of deprecation warnings for inline modifiers. (#1490) | 305ccbe27ea5ba82fd2d8c32ec739f980e524330 | Serhiy Storchaka | 2017-05-10 03:05:20 |
bpo-30320: test_eintr now uses pthread_sigmask() (#1523) | 211a392cc15f9a7b1b8ce65d8f6c9f8237d1b77f | Victor Stinner | 2017-05-10 00:37:42 |
PCbuild/build.bat: pass command line parameters when building PGO (#1510) | 291557e2904fa149ee3d56142f41acf63c47fea3 | Charles | 2017-05-09 21:58:48 |
bpo-30285: Optimize case-insensitive matching and searching (#1482) | 6d336a027913327fc042b0d758a16724fea27b9c | Serhiy Storchaka | 2017-05-09 20:37:14 |
bpo-30024: Circular imports involving absolute imports with binding (#1264) | f93234bb8a87855f295d441524e519481ce6ab13 | Serhiy Storchaka | 2017-05-09 19:31:05 |
bpo-30273: update distutils.sysconfig for venv's created from Python (#1515) | dbdea629e2e0e4bd8845aa55041e0a0ca4172cf3 | Jeremy Kloth | 2017-05-09 15:24:13 |
bpo-30258: regrtest: Fix run_tests_multiprocess() (#1479) | 74683fc6247c522ae955a6e7308b8ff51def35d8 | Victor Stinner | 2017-05-09 09:34:01 |
bpo-29990: Fix range checking in GB18030 decoder (#1495) | 9da408d15bdef624a5632182cb4edf98001fa82f | Xiang Zhang | 2017-05-09 03:38:32 |
bpo-30289: remove Misc/python-config.sh when make distclean (#1498) | fa5abac1e6cd74979557d5a6f960a55f40a10b0e | Xiang Zhang | 2017-05-09 02:32:13 |
bpo-29979: Rewrite cgi.parse_multipart to make it consistent with FieldStorage (#991) | cc3fa204d357be5fafc10eb8c2a80fe0bca998f1 | Pierre Quentel | 2017-05-08 12:08:34 |
Fix a trivial typo in global section (#1497) | f34c6850203a2406c4950af7a9c8a134145df4ea | Jim Fasarakis-Hilliard | 2017-05-08 11:36:29 |
Closes bpo-30168: indent methods in Logger Class (#1295) | 55ace65eba587fe3cf3759a43cccf85214651971 | Jim Fasarakis-Hilliard | 2017-05-07 18:40:18 |
Revert bpo-26293 for zipfile breakage. See also bpo-29094. (#1484) | 3763ea865cee5bbabcce11cd577811135e0fc747 | Serhiy Storchaka | 2017-05-06 11:46:01 |
bpo-30218: support path-like objects in shutil.unpack_archive() (GH-1367) | a12df7b7d40dbf47825917c8fa03d2c09b5a382c | Jelle Zijlstra | 2017-05-05 21:27:12 |
bpo-29243: Fix Makefile with respect to --enable-optimizations (#1478) | a1054c3b0037d4c2a5492e79fc193f36245366c7 | torsava | 2017-05-05 15:35:50 |
bpo-29920: Document cgitb.text() and cgitb.html() functions (GH-849) | c07b3a15be5e0a68a73b4c532861ed8de6932bd2 | masklinn | 2017-05-05 08:15:12 |
bpo-30279: Remove unused Python/thread_foobar.h (#1473) | fdaeea620f8c78da89cddba4ab010c64535800e0 | Masayuki Yamamoto | 2017-05-05 08:04:13 |
bpo-30264: ExpatParser closes the source on error (#1451) | ef9c0e732fc50aefbdd7c5a80e04e14b31684e66 | Victor Stinner | 2017-05-05 07:46:47 |
bpo-30277: Replace _sre.getlower() with _sre.ascii_tolower() and _sre.unicode_tolower(). (#1468) | 7186cc29be352bed6f1110873283d073fd0643e4 | Serhiy Storchaka | 2017-05-05 07:42:46 |
File | Lines added | Lines deleted |
---|---|---|
Doc/c-api/slice.rst | 1 | 1 |
Objects/sliceobject.c | 5 | 3 |
Python/ceval.c | 1 | 1 |
File Doc/c-api/slice.rst changed (mode: 100644) (index aece011a99..f8395ec8d7) | |||
... | ... | Slice Objects | |
75 | 75 | Extract the start, stop and step data members from a slice object as | Extract the start, stop and step data members from a slice object as |
76 | 76 | C integers. Silently reduce values larger than ``PY_SSIZE_T_MAX`` to | C integers. Silently reduce values larger than ``PY_SSIZE_T_MAX`` to |
77 | 77 | ``PY_SSIZE_T_MAX``, silently boost the start and stop values less than | ``PY_SSIZE_T_MAX``, silently boost the start and stop values less than |
78 | ``-PY_SSIZE_T_MAX-1`` to ``-PY_SSIZE_T_MAX-1``, and silently boost the step | ||
78 | ``PY_SSIZE_T_MIN`` to ``PY_SSIZE_T_MIN``, and silently boost the step | ||
79 | 79 | values less than ``-PY_SSIZE_T_MAX`` to ``-PY_SSIZE_T_MAX``. | values less than ``-PY_SSIZE_T_MAX`` to ``-PY_SSIZE_T_MAX``. |
80 | 80 | ||
81 | 81 | Return ``-1`` on error, ``0`` on success. | Return ``-1`` on error, ``0`` on success. |
File Objects/sliceobject.c changed (mode: 100644) (index ebc44642fe..4263737e41) | |||
... | ... | PySlice_Unpack(PyObject *_r, | |
197 | 197 | PySliceObject *r = (PySliceObject*)_r; | PySliceObject *r = (PySliceObject*)_r; |
198 | 198 | /* this is harder to get right than you might think */ | /* this is harder to get right than you might think */ |
199 | 199 | ||
200 | Py_BUILD_ASSERT(PY_SSIZE_T_MIN + 1 <= -PY_SSIZE_T_MAX); | ||
201 | |||
200 | 202 | if (r->step == Py_None) { | if (r->step == Py_None) { |
201 | 203 | *step = 1; | *step = 1; |
202 | 204 | } | } |
... | ... | PySlice_Unpack(PyObject *_r, | |
217 | 219 | } | } |
218 | 220 | ||
219 | 221 | if (r->start == Py_None) { | if (r->start == Py_None) { |
220 | *start = *step < 0 ? PY_SSIZE_T_MAX-1 : 0;; | ||
222 | *start = *step < 0 ? PY_SSIZE_T_MAX : 0; | ||
221 | 223 | } | } |
222 | 224 | else { | else { |
223 | 225 | if (!_PyEval_SliceIndex(r->start, start)) return -1; | if (!_PyEval_SliceIndex(r->start, start)) return -1; |
224 | 226 | } | } |
225 | 227 | ||
226 | 228 | if (r->stop == Py_None) { | if (r->stop == Py_None) { |
227 | *stop = *step < 0 ? -PY_SSIZE_T_MAX : PY_SSIZE_T_MAX; | ||
229 | *stop = *step < 0 ? PY_SSIZE_T_MIN : PY_SSIZE_T_MAX; | ||
228 | 230 | } | } |
229 | 231 | else { | else { |
230 | 232 | if (!_PyEval_SliceIndex(r->stop, stop)) return -1; | if (!_PyEval_SliceIndex(r->stop, stop)) return -1; |
... | ... | PySlice_AdjustIndices(Py_ssize_t length, | |
258 | 260 | *stop = (step < 0) ? -1 : 0; | *stop = (step < 0) ? -1 : 0; |
259 | 261 | } | } |
260 | 262 | } | } |
261 | else if (*stop >= length) { | ||
263 | else if (*stop >= length) { | ||
262 | 264 | *stop = (step < 0) ? length - 1 : length; | *stop = (step < 0) ? length - 1 : length; |
263 | 265 | } | } |
264 | 266 |
File Python/ceval.c changed (mode: 100644) (index afd305cf9a..23fd088098) | |||
... | ... | do_call_core(PyObject *func, PyObject *callargs, PyObject *kwdict) | |
4889 | 4889 | /* Extract a slice index from a PyLong or an object with the | /* Extract a slice index from a PyLong or an object with the |
4890 | 4890 | nb_index slot defined, and store in *pi. | nb_index slot defined, and store in *pi. |
4891 | 4891 | Silently reduce values larger than PY_SSIZE_T_MAX to PY_SSIZE_T_MAX, | Silently reduce values larger than PY_SSIZE_T_MAX to PY_SSIZE_T_MAX, |
4892 | and silently boost values less than -PY_SSIZE_T_MAX-1 to -PY_SSIZE_T_MAX-1. | ||
4892 | and silently boost values less than PY_SSIZE_T_MIN to PY_SSIZE_T_MIN. | ||
4893 | 4893 | Return 0 on error, 1 on success. | Return 0 on error, 1 on success. |
4894 | 4894 | */ | */ |
4895 | 4895 | int | int |