List of commits:
Subject Hash Author Date (UTC)
bpo-29746: Update marshal docs to Python 3. (#547) c611a5b1d4fab0123bf622f06c3bfa510221dc32 Serhiy Storchaka 2017-03-12 06:53:22
bpo-29763: Use support.unlink instead of os.unlink (GH-624) 93710c152e6bcfffdf2f1f15bb5f75b013aef422 Zachary Ware 2017-03-12 04:10:07
bpo-29656: Handle PR branches in 'make patchcheck' (#302) 482f7a274fa52b7ba34ff308cd9acdcac9f41ba5 Nick Coghlan 2017-03-12 03:19:08
bpo-26121: Use C library implementation for math functions: (#515) 97553fdf9daa8231eb05a1ca9933a2b03b0bdad0 Serhiy Storchaka 2017-03-11 21:37:16
Only trigger AppVeyor on code or config changes (GH-611) c5d3bfea0b0bba34bc3cd517a12153e189c80556 Zachary Ware 2017-03-11 20:55:35
tempfile.rst: Fix some typos (GH-610) d3b8f98696b905367da3975f73b482bac380b51c Jelle Zijlstra 2017-03-11 17:34:55
bpo-20185: Convert float object implementation to Argument Clinic. (#543) b5c51d3dd95bbfde533655fb86ac0f96f771ba7b Serhiy Storchaka 2017-03-11 07:21:05
bpo-20185: Convert list object implementation to Argument Clinic. (#542) fdd42c481edba4261f861fc1dfe24bbd79b5a17a Serhiy Storchaka 2017-03-11 07:19:20
bpo-29770: remove outdated PYO related info (GH-590) 0710d754255e731e6fcc3f206b51db6156da17c8 Xiang Zhang 2017-03-11 05:02:52
bpo-29784: Fix the reference to shutil.copy in the docs (GH-602) 70ee0cd5c2a3dba82cb8e0c0742c012f9134c040 Mariatta 2017-03-11 02:17:21
bpo-28810: Document changes to CALL_FUNCTION opcodes (GH-250) 4b2a2a425a906c8e4eb8daee14ab1793e225f726 Ivan Levkivskyi 2017-03-10 22:52:35
bpo-29741: Clean up C implementations of BytesIO and StringIO. (#606) 740025478dcd0e9e4028507f32375c85f849fb07 orenmn 2017-03-10 22:52:01
bpo-28810: Document BUILD_TUPLE_UNPACK_WITH_CALL bytecode added in 3.6 (GH-239) 7e52c3e7aefb4cdaa0662fc01ff68a5e976b77ca Ivan Levkivskyi 2017-03-10 22:16:44
bpo-28739: Document that f-strings cannot be used as docstring (GH-592) d4e89287b397c7382c12d3f3d9fd901fd8243b3c Mariatta 2017-03-10 16:58:40
Ignore Include/pydtrace_probes.h (#597) 50da40fd5295c8ca75f7bbdc1009714680e99ac0 Łukasz Langa 2017-03-10 13:29:43
bpo-29773: Add more cases for testing string to float conversion errors. (#580) 9e6ac83acae31de2b072e665e177db9fcdf7c049 Serhiy Storchaka 2017-03-09 18:07:58
bpo-29619: Convert st_ino using unsigned integer (#557) 0f6d73343d342c106cda2219ebb8a6f0c4bd9b3c Victor Stinner 2017-03-09 16:34:28
bpo-29774: Improve error reporting for corrupted extra field in ZIP file. (#583) feccdb2a249a71be330765be77dee57121866779 Serhiy Storchaka 2017-03-09 16:34:03
bpo-28298: make array 'Q', 'L' and 'I' accept big intables as elements (#570) 964281af59d7a17d923c4d72357e48832b774e39 orenmn 2017-03-09 09:35:28
bpo-29768: Fixed compile-time check for expat version. (#574) 22e707fa04476710ba5cc7e2206e4ac66743931b Serhiy Storchaka 2017-03-09 07:47:52
Commit c611a5b1d4fab0123bf622f06c3bfa510221dc32 - bpo-29746: Update marshal docs to Python 3. (#547)
Author: Serhiy Storchaka
Author date (UTC): 2017-03-12 06:53
Committer name: GitHub
Committer date (UTC): 2017-03-12 06:53
Parent(s): 93710c152e6bcfffdf2f1f15bb5f75b013aef422
Signer:
Signing key:
Signing status: N
Tree: fcdc7f1ece4dff3acdebd3cb16458c64c2ff847f
File Lines added Lines deleted
Doc/c-api/marshal.rst 4 4
Doc/glossary.rst 7 0
Doc/library/marshal.rst 8 11
Python/marshal.c 12 14
File Doc/c-api/marshal.rst changed (mode: 100644) (index a6d0f4688d..c6d1d02a2f)
... ... unmarshalling. Version 2 uses a binary format for floating point numbers.
34 34
35 35 .. c:function:: PyObject* PyMarshal_WriteObjectToString(PyObject *value, int version) .. c:function:: PyObject* PyMarshal_WriteObjectToString(PyObject *value, int version)
36 36
37 Return a string object containing the marshalled representation of *value*.
37 Return a bytes object containing the marshalled representation of *value*.
38 38 *version* indicates the file format. *version* indicates the file format.
39 39
40 40
 
... ... written using these routines?
88 88 :exc:`TypeError`) and returns *NULL*. :exc:`TypeError`) and returns *NULL*.
89 89
90 90
91 .. c:function:: PyObject* PyMarshal_ReadObjectFromString(const char *string, Py_ssize_t len)
91 .. c:function:: PyObject* PyMarshal_ReadObjectFromString(const char *data, Py_ssize_t len)
92 92
93 Return a Python object from the data stream in a character buffer
94 containing *len* bytes pointed to by *string*.
93 Return a Python object from the data stream in a byte buffer
94 containing *len* bytes pointed to by *data*.
95 95
96 96 On error, sets the appropriate exception (:exc:`EOFError` or On error, sets the appropriate exception (:exc:`EOFError` or
97 97 :exc:`TypeError`) and returns *NULL*. :exc:`TypeError`) and returns *NULL*.
File Doc/glossary.rst changed (mode: 100644) (index e07ab0df2f..495934afe7)
... ... Glossary
131 131 binary file binary file
132 132 A :term:`file object` able to read and write A :term:`file object` able to read and write
133 133 :term:`bytes-like objects <bytes-like object>`. :term:`bytes-like objects <bytes-like object>`.
134 Examples of binary files are files opened in binary mode (``'rb'``,
135 ``'wb'`` or ``'rb+'``), :data:`sys.stdin.buffer`,
136 :data:`sys.stdout.buffer`, and instances of :class:`io.BytesIO` and
137 :class:`gzip.GzipFile`.
134 138
135 139 .. seealso:: .. seealso::
136 140 A :term:`text file` reads and writes :class:`str` objects. A :term:`text file` reads and writes :class:`str` objects.
 
... ... Glossary
966 970 A :term:`file object` able to read and write :class:`str` objects. A :term:`file object` able to read and write :class:`str` objects.
967 971 Often, a text file actually accesses a byte-oriented datastream Often, a text file actually accesses a byte-oriented datastream
968 972 and handles the :term:`text encoding` automatically. and handles the :term:`text encoding` automatically.
973 Examples of text files are files opened in text mode (``'r'`` or ``'w'``),
974 :data:`sys.stdin`, :data:`sys.stdout`, and instances of
975 :class:`io.StringIO`.
969 976
970 977 .. seealso:: .. seealso::
971 978 A :term:`binary file` reads and write :class:`bytes` objects. A :term:`binary file` reads and write :class:`bytes` objects.
File Doc/library/marshal.rst changed (mode: 100644) (index 1ffc6effc7..d65afc2004)
... ... For format *version* lower than 3, recursive lists, sets and dictionaries cannot
49 49 be written (see below). be written (see below).
50 50
51 51 There are functions that read/write files as well as functions operating on There are functions that read/write files as well as functions operating on
52 strings.
52 bytes-like objects.
53 53
54 54 The module defines these functions: The module defines these functions:
55 55
 
... ... The module defines these functions:
57 57 .. function:: dump(value, file[, version]) .. function:: dump(value, file[, version])
58 58
59 59 Write the value on the open file. The value must be a supported type. The Write the value on the open file. The value must be a supported type. The
60 file must be an open file object such as ``sys.stdout`` or returned by
61 :func:`open` or :func:`os.popen`. It must be opened in binary mode (``'wb'``
62 or ``'w+b'``).
60 file must be a writeable :term:`binary file`.
63 61
64 62 If the value has (or contains an object that has) an unsupported type, a If the value has (or contains an object that has) an unsupported type, a
65 63 :exc:`ValueError` exception is raised --- but garbage data will also be written :exc:`ValueError` exception is raised --- but garbage data will also be written
 
... ... The module defines these functions:
74 72 Read one value from the open file and return it. If no valid value is read Read one value from the open file and return it. If no valid value is read
75 73 (e.g. because the data has a different Python version's incompatible marshal (e.g. because the data has a different Python version's incompatible marshal
76 74 format), raise :exc:`EOFError`, :exc:`ValueError` or :exc:`TypeError`. The format), raise :exc:`EOFError`, :exc:`ValueError` or :exc:`TypeError`. The
77 file must be an open file object opened in binary mode (``'rb'`` or
78 ``'r+b'``).
75 file must be a readable :term:`binary file`.
79 76
80 77 .. note:: .. note::
81 78
 
... ... The module defines these functions:
85 82
86 83 .. function:: dumps(value[, version]) .. function:: dumps(value[, version])
87 84
88 Return the string that would be written to a file by ``dump(value, file)``. The
85 Return the bytes object that would be written to a file by ``dump(value, file)``. The
89 86 value must be a supported type. Raise a :exc:`ValueError` exception if value value must be a supported type. Raise a :exc:`ValueError` exception if value
90 87 has (or contains an object that has) an unsupported type. has (or contains an object that has) an unsupported type.
91 88
 
... ... The module defines these functions:
93 90 (see below). (see below).
94 91
95 92
96 .. function:: loads(string)
93 .. function:: loads(bytes)
97 94
98 Convert the string to a value. If no valid value is found, raise
99 :exc:`EOFError`, :exc:`ValueError` or :exc:`TypeError`. Extra characters in the
100 string are ignored.
95 Convert the :term:`bytes-like object` to a value. If no valid value is found, raise
96 :exc:`EOFError`, :exc:`ValueError` or :exc:`TypeError`. Extra bytes in the
97 input are ignored.
101 98
102 99
103 100 In addition, the following constants are defined: In addition, the following constants are defined:
File Python/marshal.c changed (mode: 100644) (index d71d3c2b9d..a0fb0f3d8a)
... ... w_complex_object(PyObject *v, char flag, WFILE *p)
549 549 w_object(co->co_lnotab, p); w_object(co->co_lnotab, p);
550 550 } }
551 551 else if (PyObject_CheckBuffer(v)) { else if (PyObject_CheckBuffer(v)) {
552 /* Write unknown bytes-like objects as a byte string */
552 /* Write unknown bytes-like objects as a bytes object */
553 553 Py_buffer view; Py_buffer view;
554 554 if (PyObject_GetBuffer(v, &view, PyBUF_SIMPLE) != 0) { if (PyObject_GetBuffer(v, &view, PyBUF_SIMPLE) != 0) {
555 555 w_byte(TYPE_UNKNOWN, p); w_byte(TYPE_UNKNOWN, p);
 
... ... r_object(RFILE *p)
1086 1086 if (PyErr_Occurred()) if (PyErr_Occurred())
1087 1087 break; break;
1088 1088 if (n < 0 || n > SIZE32_MAX) { if (n < 0 || n > SIZE32_MAX) {
1089 PyErr_SetString(PyExc_ValueError, "bad marshal data (string size out of range)");
1089 PyErr_SetString(PyExc_ValueError, "bad marshal data (bytes object size out of range)");
1090 1090 break; break;
1091 1091 } }
1092 1092 v = PyBytes_FromStringAndSize((char *)NULL, n); v = PyBytes_FromStringAndSize((char *)NULL, n);
 
... ... r_object(RFILE *p)
1110 1110 if (PyErr_Occurred()) if (PyErr_Occurred())
1111 1111 break; break;
1112 1112 if (n < 0 || n > SIZE32_MAX) { if (n < 0 || n > SIZE32_MAX) {
1113 PyErr_SetString(PyExc_ValueError, "bad marshal data (unicode size out of range)");
1113 PyErr_SetString(PyExc_ValueError, "bad marshal data (string size out of range)");
1114 1114 break; break;
1115 1115 } }
1116 1116 goto _read_ascii; goto _read_ascii;
 
... ... r_object(RFILE *p)
1150 1150 if (PyErr_Occurred()) if (PyErr_Occurred())
1151 1151 break; break;
1152 1152 if (n < 0 || n > SIZE32_MAX) { if (n < 0 || n > SIZE32_MAX) {
1153 PyErr_SetString(PyExc_ValueError, "bad marshal data (unicode size out of range)");
1153 PyErr_SetString(PyExc_ValueError, "bad marshal data (string size out of range)");
1154 1154 break; break;
1155 1155 } }
1156 1156 if (n != 0) { if (n != 0) {
 
... ... PyMarshal_WriteObjectToString(PyObject *x, int version)
1612 1612 if (wf.ptr - base > PY_SSIZE_T_MAX) { if (wf.ptr - base > PY_SSIZE_T_MAX) {
1613 1613 Py_DECREF(wf.str); Py_DECREF(wf.str);
1614 1614 PyErr_SetString(PyExc_OverflowError, PyErr_SetString(PyExc_OverflowError,
1615 "too much marshal data for a string");
1615 "too much marshal data for a bytes object");
1616 1616 return NULL; return NULL;
1617 1617 } }
1618 1618 if (_PyBytes_Resize(&wf.str, (Py_ssize_t)(wf.ptr - base)) < 0) if (_PyBytes_Resize(&wf.str, (Py_ssize_t)(wf.ptr - base)) < 0)
 
... ... PyDoc_STRVAR(dump_doc,
1658 1658 "dump(value, file[, version])\n\ "dump(value, file[, version])\n\
1659 1659 \n\ \n\
1660 1660 Write the value on the open file. The value must be a supported type.\n\ Write the value on the open file. The value must be a supported type.\n\
1661 The file must be an open file object such as sys.stdout or returned by\n\
1662 open() or os.popen(). It must be opened in binary mode ('wb' or 'w+b').\n\
1661 The file must be a writeable binary file.\n\
1663 1662 \n\ \n\
1664 1663 If the value has (or contains an object that has) an unsupported type, a\n\ If the value has (or contains an object that has) an unsupported type, a\n\
1665 1664 ValueError exception is raised - but garbage data will also be written\n\ ValueError exception is raised - but garbage data will also be written\n\
 
... ... PyDoc_STRVAR(load_doc,
1715 1714 Read one value from the open file and return it. If no valid value is\n\ Read one value from the open file and return it. If no valid value is\n\
1716 1715 read (e.g. because the data has a different Python version's\n\ read (e.g. because the data has a different Python version's\n\
1717 1716 incompatible marshal format), raise EOFError, ValueError or TypeError.\n\ incompatible marshal format), raise EOFError, ValueError or TypeError.\n\
1718 The file must be an open file object opened in binary mode ('rb' or\n\
1719 'r+b').\n\
1717 The file must be a readable binary file.\n\
1720 1718 \n\ \n\
1721 1719 Note: If an object containing an unsupported type was marshalled with\n\ Note: If an object containing an unsupported type was marshalled with\n\
1722 1720 dump(), load() will substitute None for the unmarshallable type."); dump(), load() will substitute None for the unmarshallable type.");
 
... ... marshal_dumps(PyObject *self, PyObject *args)
1735 1733 PyDoc_STRVAR(dumps_doc, PyDoc_STRVAR(dumps_doc,
1736 1734 "dumps(value[, version])\n\ "dumps(value[, version])\n\
1737 1735 \n\ \n\
1738 Return the string that would be written to a file by dump(value, file).\n\
1736 Return the bytes object that would be written to a file by dump(value, file).\n\
1739 1737 The value must be a supported type. Raise a ValueError exception if\n\ The value must be a supported type. Raise a ValueError exception if\n\
1740 1738 value has (or contains an object that has) an unsupported type.\n\ value has (or contains an object that has) an unsupported type.\n\
1741 1739 \n\ \n\
 
... ... marshal_loads(PyObject *self, PyObject *args)
1771 1769 PyDoc_STRVAR(loads_doc, PyDoc_STRVAR(loads_doc,
1772 1770 "loads(bytes)\n\ "loads(bytes)\n\
1773 1771 \n\ \n\
1774 Convert the bytes object to a value. If no valid value is found, raise\n\
1775 EOFError, ValueError or TypeError. Extra characters in the input are\n\
1772 Convert the bytes-like object to a value. If no valid value is found,\n\
1773 raise EOFError, ValueError or TypeError. Extra bytes in the input are\n\
1776 1774 ignored."); ignored.");
1777 1775
1778 1776 static PyMethodDef marshal_methods[] = { static PyMethodDef marshal_methods[] = {
 
... ... Functions:\n\
1810 1808 \n\ \n\
1811 1809 dump() -- write value to a file\n\ dump() -- write value to a file\n\
1812 1810 load() -- read value from a file\n\ load() -- read value from a file\n\
1813 dumps() -- write value to a string\n\
1814 loads() -- read value from a string");
1811 dumps() -- marshal value as a bytes object\n\
1812 loads() -- read value from a bytes-like object");
1815 1813
1816 1814
1817 1815
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