Skip to content

Commit d935e60

Browse files
committed
Merge remote-tracking branch 'origin/main' into gh-162752-slot-fastpath
2 parents 9c7def0 + d88a6b9 commit d935e60

3 files changed

Lines changed: 42 additions & 7 deletions

File tree

‎Doc/library/xmlrpc.client.rst‎

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ between conformable Python objects and XML on the wire.
3939
remote XML-RPC server. The required first argument is a URI (Uniform Resource
4040
Indicator), and will normally be the URL of the server. The optional second
4141
argument is a transport factory instance; by default it is an internal
42-
:class:`SafeTransport` instance for https: URLs and an internal HTTP
43-
:class:`Transport` instance otherwise. The optional third argument is an
42+
:class:`!SafeTransport` instance for https: URLs and an internal HTTP
43+
:class:`!Transport` instance otherwise. The optional third argument is an
4444
encoding, by default UTF-8. The optional fourth argument is a debugging flag.
4545

4646
The following parameters govern the use of the returned proxy instance.
@@ -142,7 +142,7 @@ between conformable Python objects and XML on the wire.
142142
via XML-RPC, use :class:`bytes` or :class:`bytearray` classes or the
143143
:class:`Binary` wrapper class described below.
144144

145-
:class:`Server` is retained as an alias for :class:`ServerProxy` for backwards
145+
:class:`!Server` is retained as an alias for :class:`ServerProxy` for backwards
146146
compatibility. New code should use :class:`ServerProxy`.
147147

148148
.. versionchanged:: 3.5
@@ -181,7 +181,7 @@ by returning data in a conformant type or by raising a :class:`Fault` or
181181
:class:`ProtocolError` exception indicating an error.
182182

183183
Servers that support the XML introspection API support some common methods
184-
grouped under the reserved :attr:`~ServerProxy.system` attribute:
184+
grouped under the reserved :attr:`!system` attribute:
185185

186186

187187
.. method:: ServerProxy.system.listMethods()
@@ -359,6 +359,23 @@ The client gets the image and saves it to a file::
359359
with open("fetched_python_logo.jpg", "wb") as handle:
360360
handle.write(proxy.python_logo().data)
361361

362+
.. _error-objects:
363+
364+
Error objects
365+
-------------
366+
367+
.. exception:: Error
368+
369+
Base class of the :exc:`Fault`, :exc:`ProtocolError` and
370+
:exc:`ResponseError` exceptions.
371+
372+
373+
.. exception:: ResponseError
374+
375+
Raised when an XML-RPC response is malformed and cannot be unmarshalled,
376+
for example when it contains an unsupported type tag.
377+
378+
362379
.. _fault-objects:
363380

364381
Fault Objects

‎Doc/tools/.nitignore‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@ Doc/library/wsgiref.rst
1818
Doc/library/xml.dom.minidom.rst
1919
Doc/library/xml.sax.reader.rst
2020
Doc/library/xml.sax.rst
21-
Doc/library/xmlrpc.client.rst
2221
Doc/library/xmlrpc.server.rst

‎Modules/_datetimemodule.c‎

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2795,12 +2795,22 @@ delta_new_impl(PyTypeObject *type, PyObject *days, PyObject *seconds,
27952795
PyObject *minutes, PyObject *hours, PyObject *weeks)
27962796
/*[clinic end generated code: output=61d7e02a92a97700 input=8aebc4cdef360d1f]*/
27972797
{
2798+
/* vectorcall passes borrowed references; hold strong references before
2799+
any conversion can execute arbitrary Python code. */
2800+
Py_XINCREF(days);
2801+
Py_XINCREF(seconds);
2802+
Py_XINCREF(microseconds);
2803+
Py_XINCREF(milliseconds);
2804+
Py_XINCREF(minutes);
2805+
Py_XINCREF(hours);
2806+
Py_XINCREF(weeks);
2807+
27982808
PyObject *self = NULL;
27992809

28002810
PyObject *current_mod;
28012811
datetime_state *st = GET_CURRENT_STATE(current_mod);
28022812
if (st == NULL) {
2803-
return NULL;
2813+
goto Done;
28042814
}
28052815

28062816
PyObject *x = NULL; /* running sum of microseconds */
@@ -2886,7 +2896,16 @@ delta_new_impl(PyTypeObject *type, PyObject *days, PyObject *seconds,
28862896
Py_DECREF(x);
28872897

28882898
Done:
2889-
RELEASE_CURRENT_STATE(st, current_mod);
2899+
Py_XDECREF(days);
2900+
Py_XDECREF(seconds);
2901+
Py_XDECREF(microseconds);
2902+
Py_XDECREF(milliseconds);
2903+
Py_XDECREF(minutes);
2904+
Py_XDECREF(hours);
2905+
Py_XDECREF(weeks);
2906+
if (st != NULL) {
2907+
RELEASE_CURRENT_STATE(st, current_mod);
2908+
}
28902909
return self;
28912910

28922911
#undef CLEANUP

0 commit comments

Comments
 (0)