From: Vinay Sajip Date: Sat, 2 Jul 2011 16:16:02 +0000 (+0100) Subject: Closes #12291 for 3.3 - merged fix from 3.2. X-Git-Tag: v3.3.0a1~1980^2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65897a386e7980a736e3492eecc9bdbb706bf4f9;p=thirdparty%2FPython%2Fcpython.git Closes #12291 for 3.3 - merged fix from 3.2. --- 65897a386e7980a736e3492eecc9bdbb706bf4f9 diff --cc Misc/NEWS index 06932608adb5,2013559be884..547c0faa8094 --- a/Misc/NEWS +++ b/Misc/NEWS @@@ -10,13 -10,9 +10,16 @@@ What's New in Python 3.3 Alpha 1 Core and Builtins ----------------- + - Issue #12291: You can now load multiple marshalled objects from a stream, + with other data interleaved between marshalled objects. + +- Issue #12356: When required positional or keyword-only arguments are not + given, produce a informative error message which includes the name(s) of the + missing arguments. + +- Issue #12370: Fix super with not arguments when __class__ is overriden in the + class body. + - Issue #12084: os.stat on Windows now works properly with relative symbolic links when called from any directory. diff --cc Python/marshal.c index 7b327ade01d9,396e05c63817..b8d06ad28648 --- a/Python/marshal.c +++ b/Python/marshal.c @@@ -57,10 -57,11 +57,11 @@@ typedef struct int error; /* see WFERR_* values */ int depth; /* If fp == NULL, the following are valid: */ + PyObject * readable; /* Stream-like object being read from */ PyObject *str; + PyObject *current_filename; char *ptr; char *end; - PyObject *strings; /* dict on marshal, list on unmarshal */ int version; } WFILE; @@@ -1049,8 -1129,9 +1138,9 @@@ PyMarshal_ReadShortFromFile(FILE *fp { RFILE rf; assert(fp); + rf.readable = NULL; rf.fp = fp; - rf.strings = NULL; + rf.current_filename = NULL; rf.end = rf.ptr = NULL; return r_short(&rf); } @@@ -1060,7 -1141,8 +1150,8 @@@ PyMarshal_ReadLongFromFile(FILE *fp { RFILE rf; rf.fp = fp; + rf.readable = NULL; - rf.strings = NULL; + rf.current_filename = NULL; rf.ptr = rf.end = NULL; return r_long(&rf); } @@@ -1121,7 -1203,8 +1212,8 @@@ PyMarshal_ReadObjectFromFile(FILE *fp RFILE rf; PyObject *result; rf.fp = fp; + rf.readable = NULL; - rf.strings = PyList_New(0); + rf.current_filename = NULL; rf.depth = 0; rf.ptr = rf.end = NULL; result = r_object(&rf); @@@ -1134,11 -1218,13 +1226,12 @@@ PyMarshal_ReadObjectFromString(char *st RFILE rf; PyObject *result; rf.fp = NULL; + rf.readable = NULL; + rf.current_filename = NULL; rf.ptr = str; rf.end = str + len; - rf.strings = PyList_New(0); rf.depth = 0; result = r_object(&rf); - Py_DECREF(rf.strings); return result; } @@@ -1300,11 -1390,13 +1395,12 @@@ marshal_loads(PyObject *self, PyObject s = p.buf; n = p.len; rf.fp = NULL; + rf.readable = NULL; + rf.current_filename = NULL; rf.ptr = s; rf.end = s + n; - rf.strings = PyList_New(0); rf.depth = 0; result = read_object(&rf); - Py_DECREF(rf.strings); PyBuffer_Release(&p); return result; }