List of commits:
Subject Hash Author Date (UTC)
bpo-30243: Fixed the possibility of a crash in _json. (#1420) 76a3e51a403bc84ed536921866c86dd7d07aaa7e Serhiy Storchaka 2017-05-05 07:08:49
bpo-30215: Make re.compile() locale agnostic. (#1361) 898ff03e1e7925ecde3da66327d3cdc7e07625ba Serhiy Storchaka 2017-05-05 05:53:40
Make code coverage less strict (GH-1438) 647c3d381e67490e82cdbbe6c96e46d5e1628ce2 Brett Cannon 2017-05-04 21:58:54
bpo-30273: Update sysconfig (#1464) b109a1d3360fc4bb87b9887264e3634632d392ca Victor Stinner 2017-05-04 21:29:09
bpo-30185: avoid KeyboardInterrupt tracebacks in forkserver (#1319) 6dd4d734ed207ba16b017e38f8909de7ef187e29 Antoine Pitrou 2017-05-04 14:44:53
bpo-30263: regrtest: log system load (#1452) 3d0056842c5e06b4102f990b59ab3b607f932dd8 Victor Stinner 2017-05-04 13:21:12
bpo-29956: Improve the math.exp() related documentation. (#1073) dbaf746b6de0ee431c809d3175ab40ccc18898a8 Serhiy Storchaka 2017-05-04 09:25:09
bpo-30166: Import command-line parsing modules only when needed. (#1293) 7e4db2f253c555568d56177c2fd083bcf8f88d34 Serhiy Storchaka 2017-05-04 05:17:47
bpo-30225: Fix is_valid_fd() on macOS Tiger (#1443) 1c4670ea0cc3d208121af11b9b973e6bb268e570 Victor Stinner 2017-05-03 22:45:56
bpo-30184: Add tests for invalid use of PyArg_ParseTupleAndKeywords. (#1316) 5f161fd86dd5bb936a1a2a13391b13b7e59ec201 Serhiy Storchaka 2017-05-03 21:03:23
Add myself to mention-bot's alwaysNotifyForPaths for ssl/hashlib (#1425) feec3dc9c308052754f9e4848c1c1ddb007e9f66 Christian Heimes 2017-05-03 18:17:54
Explicitly mention what should (not) be discussed on GitHub (GH-1437) 7fdd30975e3fa9ec4be62464a9fcab7798d0ed6e Brett Cannon 2017-05-03 17:51:55
bpo-28315: Improve code examples in docs (GH-1372) 8856940cf2e82cb17db2b684cd5732fe658605ca UltimateCoder 2017-05-03 16:46:45
bpo-23404: make touch becomes make regen-all (#1405) a5c62a8e9f0de6c4133825a5710984a3cd5e102b Victor Stinner 2017-05-03 16:21:48
bpo-30103: Allow Uuencode in Python using backtick as zero instead of space (#1326) 13f1f423fac39f8f14a3ce919dd236975517d5c6 Xiang Zhang 2017-05-03 03:16:21
Fix tests: getsockname() can return None on OS X on unbound sockets (#1400) 0360a9d015ddbc4e3d58e3ab4b433da27bf1db3a Antoine Pitrou 2017-05-02 21:48:26
bpo-30232: Regenerate configure (#1396) 9ed34a89532763cf89f5e11fffb91ef7dee29fed Victor Stinner 2017-05-02 20:35:58
bpo-30232: Support Git worktree in configure.ac (#1391) 5facdbb29169c2799c42f887cef4cd9d087b0167 Victor Stinner 2017-05-02 19:42:48
Remove outdated tests in test_isinstance (GH-1393) 094909ad69a6654ac43c69ebdced060fbbbbede8 Jim Fasarakis-Hilliard 2017-05-02 17:17:18
bpo-28556: Routine updates to typing (#1366) f06e0218ef6007667f5d61184b85a81a0466d3ae Ivan Levkivskyi 2017-05-02 17:14:07
Commit 76a3e51a403bc84ed536921866c86dd7d07aaa7e - bpo-30243: Fixed the possibility of a crash in _json. (#1420)
It was possible to get a core dump by using uninitialized
_json objects. Now __new__ methods create initialized objects.
__init__ methods are removed.
Author: Serhiy Storchaka
Author date (UTC): 2017-05-05 07:08
Committer name: GitHub
Committer date (UTC): 2017-05-05 07:08
Parent(s): 898ff03e1e7925ecde3da66327d3cdc7e07625ba
Signing key:
Tree: 0cfc6ca2cd2da36730d15d6b9c5d7ffaac955abd
File Lines added Lines deleted
Misc/NEWS 4 0
Modules/_json.c 20 66
File Misc/NEWS changed (mode: 100644) (index f2c1994ccf..4500021f04)
... ... Extension Modules
317 317 Library Library
318 318 ------- -------
319 319
320 - bpo-30243: Removed the __init__ methods of _json's scanner and encoder.
321 Misusing them could cause memory leaks or crashes. Now scanner and encoder
322 objects are completely initialized in the __new__ methods.
323
320 324 - bpo-30215: Compiled regular expression objects with the re.LOCALE flag no - bpo-30215: Compiled regular expression objects with the re.LOCALE flag no
321 325 longer depend on the locale at compile time. Only the locale at matching longer depend on the locale at compile time. Only the locale at matching
322 326 time affects the result of matching. time affects the result of matching.
File Modules/_json.c changed (mode: 100644) (index 28fdc79834..e78e371112)
... ... static PyObject *
89 89 _build_rval_index_tuple(PyObject *rval, Py_ssize_t idx); _build_rval_index_tuple(PyObject *rval, Py_ssize_t idx);
90 90 static PyObject * static PyObject *
91 91 scanner_new(PyTypeObject *type, PyObject *args, PyObject *kwds); scanner_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
92 static int
93 scanner_init(PyObject *self, PyObject *args, PyObject *kwds);
94 92 static void static void
95 93 scanner_dealloc(PyObject *self); scanner_dealloc(PyObject *self);
96 94 static int static int
97 95 scanner_clear(PyObject *self); scanner_clear(PyObject *self);
98 96 static PyObject * static PyObject *
99 97 encoder_new(PyTypeObject *type, PyObject *args, PyObject *kwds); encoder_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
100 static int
101 encoder_init(PyObject *self, PyObject *args, PyObject *kwds);
102 98 static void static void
103 99 encoder_dealloc(PyObject *self); encoder_dealloc(PyObject *self);
104 100 static int static int
 
... ... static PyObject *
1200 1196 scanner_new(PyTypeObject *type, PyObject *args, PyObject *kwds) scanner_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
1201 1197 { {
1202 1198 PyScannerObject *s; PyScannerObject *s;
1203 s = (PyScannerObject *)type->tp_alloc(type, 0);
1204 if (s != NULL) {
1205 s->strict = NULL;
1206 s->object_hook = NULL;
1207 s->object_pairs_hook = NULL;
1208 s->parse_float = NULL;
1209 s->parse_int = NULL;
1210 s->parse_constant = NULL;
1211 }
1212 return (PyObject *)s;
1213 }
1214
1215 static int
1216 scanner_init(PyObject *self, PyObject *args, PyObject *kwds)
1217 {
1218 /* Initialize Scanner object */
1219 1199 PyObject *ctx; PyObject *ctx;
1220 1200 static char *kwlist[] = {"context", NULL}; static char *kwlist[] = {"context", NULL};
1221 PyScannerObject *s;
1222
1223 assert(PyScanner_Check(self));
1224 s = (PyScannerObject *)self;
1225 1201
1226 1202 if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:make_scanner", kwlist, &ctx)) if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:make_scanner", kwlist, &ctx))
1227 return -1;
1203 return NULL;
1228 1204
1229 if (s->memo == NULL) {
1230 s->memo = PyDict_New();
1231 if (s->memo == NULL)
1232 goto bail;
1205 s = (PyScannerObject *)type->tp_alloc(type, 0);
1206 if (s == NULL) {
1207 return NULL;
1233 1208 } }
1234 1209
1210 s->memo = PyDict_New();
1211 if (s->memo == NULL)
1212 goto bail;
1213
1235 1214 /* All of these will fail "gracefully" so we don't need to verify them */ /* All of these will fail "gracefully" so we don't need to verify them */
1236 1215 s->strict = PyObject_GetAttrString(ctx, "strict"); s->strict = PyObject_GetAttrString(ctx, "strict");
1237 1216 if (s->strict == NULL) if (s->strict == NULL)
 
... ... scanner_init(PyObject *self, PyObject *args, PyObject *kwds)
1252 1231 if (s->parse_constant == NULL) if (s->parse_constant == NULL)
1253 1232 goto bail; goto bail;
1254 1233
1255 return 0;
1234 return (PyObject *)s;
1256 1235
1257 1236 bail: bail:
1258 Py_CLEAR(s->strict);
1259 Py_CLEAR(s->object_hook);
1260 Py_CLEAR(s->object_pairs_hook);
1261 Py_CLEAR(s->parse_float);
1262 Py_CLEAR(s->parse_int);
1263 Py_CLEAR(s->parse_constant);
1264 return -1;
1237 Py_DECREF(s);
1238 return NULL;
1265 1239 } }
1266 1240
1267 1241 PyDoc_STRVAR(scanner_doc, "JSON scanner object"); PyDoc_STRVAR(scanner_doc, "JSON scanner object");
 
... ... PyTypeObject PyScannerType = {
1303 1277 0, /* tp_descr_get */ 0, /* tp_descr_get */
1304 1278 0, /* tp_descr_set */ 0, /* tp_descr_set */
1305 1279 0, /* tp_dictoffset */ 0, /* tp_dictoffset */
1306 scanner_init, /* tp_init */
1280 0, /* tp_init */
1307 1281 0,/* PyType_GenericAlloc, */ /* tp_alloc */ 0,/* PyType_GenericAlloc, */ /* tp_alloc */
1308 1282 scanner_new, /* tp_new */ scanner_new, /* tp_new */
1309 1283 0,/* PyObject_GC_Del, */ /* tp_free */ 0,/* PyObject_GC_Del, */ /* tp_free */
 
... ... PyTypeObject PyScannerType = {
1312 1286 static PyObject * static PyObject *
1313 1287 encoder_new(PyTypeObject *type, PyObject *args, PyObject *kwds) encoder_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
1314 1288 { {
1315 PyEncoderObject *s;
1316 s = (PyEncoderObject *)type->tp_alloc(type, 0);
1317 if (s != NULL) {
1318 s->markers = NULL;
1319 s->defaultfn = NULL;
1320 s->encoder = NULL;
1321 s->indent = NULL;
1322 s->key_separator = NULL;
1323 s->item_separator = NULL;
1324 s->sort_keys = NULL;
1325 s->skipkeys = NULL;
1326 }
1327 return (PyObject *)s;
1328 }
1329
1330 static int
1331 encoder_init(PyObject *self, PyObject *args, PyObject *kwds)
1332 {
1333 /* initialize Encoder object */
1334 1289 static char *kwlist[] = {"markers", "default", "encoder", "indent", "key_separator", "item_separator", "sort_keys", "skipkeys", "allow_nan", NULL}; static char *kwlist[] = {"markers", "default", "encoder", "indent", "key_separator", "item_separator", "sort_keys", "skipkeys", "allow_nan", NULL};
1335 1290
1336 1291 PyEncoderObject *s; PyEncoderObject *s;
 
... ... encoder_init(PyObject *self, PyObject *args, PyObject *kwds)
1338 1293 PyObject *item_separator, *sort_keys, *skipkeys; PyObject *item_separator, *sort_keys, *skipkeys;
1339 1294 int allow_nan; int allow_nan;
1340 1295
1341 assert(PyEncoder_Check(self));
1342 s = (PyEncoderObject *)self;
1343
1344 1296 if (!PyArg_ParseTupleAndKeywords(args, kwds, "OOOOUUOOp:make_encoder", kwlist, if (!PyArg_ParseTupleAndKeywords(args, kwds, "OOOOUUOOp:make_encoder", kwlist,
1345 1297 &markers, &defaultfn, &encoder, &indent, &markers, &defaultfn, &encoder, &indent,
1346 1298 &key_separator, &item_separator, &key_separator, &item_separator,
1347 1299 &sort_keys, &skipkeys, &allow_nan)) &sort_keys, &skipkeys, &allow_nan))
1348 return -1;
1300 return NULL;
1349 1301
1350 1302 if (markers != Py_None && !PyDict_Check(markers)) { if (markers != Py_None && !PyDict_Check(markers)) {
1351 1303 PyErr_Format(PyExc_TypeError, PyErr_Format(PyExc_TypeError,
1352 1304 "make_encoder() argument 1 must be dict or None, " "make_encoder() argument 1 must be dict or None, "
1353 1305 "not %.200s", Py_TYPE(markers)->tp_name); "not %.200s", Py_TYPE(markers)->tp_name);
1354 return -1;
1306 return NULL;
1355 1307 } }
1356 1308
1309 s = (PyEncoderObject *)type->tp_alloc(type, 0);
1310 if (s == NULL)
1311 return NULL;
1312
1357 1313 s->markers = markers; s->markers = markers;
1358 1314 s->defaultfn = defaultfn; s->defaultfn = defaultfn;
1359 1315 s->encoder = encoder; s->encoder = encoder;
 
... ... encoder_init(PyObject *self, PyObject *args, PyObject *kwds)
1380 1336 Py_INCREF(s->item_separator); Py_INCREF(s->item_separator);
1381 1337 Py_INCREF(s->sort_keys); Py_INCREF(s->sort_keys);
1382 1338 Py_INCREF(s->skipkeys); Py_INCREF(s->skipkeys);
1383 return 0;
1339 return (PyObject *)s;
1384 1340 } }
1385 1341
1386 1342 static PyObject * static PyObject *
 
... ... PyTypeObject PyEncoderType = {
1911 1867 0, /* tp_descr_get */ 0, /* tp_descr_get */
1912 1868 0, /* tp_descr_set */ 0, /* tp_descr_set */
1913 1869 0, /* tp_dictoffset */ 0, /* tp_dictoffset */
1914 encoder_init, /* tp_init */
1870 0, /* tp_init */
1915 1871 0, /* tp_alloc */ 0, /* tp_alloc */
1916 1872 encoder_new, /* tp_new */ encoder_new, /* tp_new */
1917 1873 0, /* tp_free */ 0, /* tp_free */
 
... ... PyInit__json(void)
1954 1910 PyObject *m = PyModule_Create(&jsonmodule); PyObject *m = PyModule_Create(&jsonmodule);
1955 1911 if (!m) if (!m)
1956 1912 return NULL; return NULL;
1957 PyScannerType.tp_new = PyType_GenericNew;
1958 1913 if (PyType_Ready(&PyScannerType) < 0) if (PyType_Ready(&PyScannerType) < 0)
1959 1914 goto fail; goto fail;
1960 PyEncoderType.tp_new = PyType_GenericNew;
1961 1915 if (PyType_Ready(&PyEncoderType) < 0) if (PyType_Ready(&PyEncoderType) < 0)
1962 1916 goto fail; goto fail;
1963 1917 Py_INCREF((PyObject*)&PyScannerType); Py_INCREF((PyObject*)&PyScannerType);
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/benf_wspdigital/cpython

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/benf_wspdigital/cpython

Clone this repository using git:
git clone git://git.rocketgit.com/user/benf_wspdigital/cpython

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main