Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8bfb11b

Browse files
authored
Merge branch 'main' into absolute-cmdexe-fallback-patch
2 parents 9cbdfca + 04ab767 commit 8bfb11b

42 files changed

Lines changed: 1284 additions & 836 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Doc/c-api/init_config.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ PyConfig
839839
will produce an error.
840840
841841
Configured by the :option:`-X int_max_str_digits <-X>` command line
842-
flag or the :envvar:`PYTHONINTMAXSTRDIGITS` environment varable.
842+
flag or the :envvar:`PYTHONINTMAXSTRDIGITS` environment variable.
843843
844844
Default: ``-1`` in Python mode. 4300
845845
(:data:`sys.int_info.default_max_str_digits`) in isolated mode.
@@ -1582,7 +1582,7 @@ applied during the "Main" phase. It may allow to customize Python in Python to
15821582
override or tune the :ref:`Path Configuration <init-path-config>`, maybe
15831583
install a custom :data:`sys.meta_path` importer or an import hook, etc.
15841584
1585-
It may become possible to calculatin the :ref:`Path Configuration
1585+
It may become possible to calculate the :ref:`Path Configuration
15861586
<init-path-config>` in Python, after the Core phase and before the Main phase,
15871587
which is one of the :pep:`432` motivation.
15881588

Doc/howto/logging-cookbook.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3628,7 +3628,7 @@ refer to the comments in the code snippet for more detailed information.
36283628
Logging to syslog with RFC5424 support
36293629
--------------------------------------
36303630

3631-
Although :rfc:`5424` dates from 2009, most syslog servers are configured by detault to
3631+
Although :rfc:`5424` dates from 2009, most syslog servers are configured by default to
36323632
use the older :rfc:`3164`, which hails from 2001. When ``logging`` was added to Python
36333633
in 2003, it supported the earlier (and only existing) protocol at the time. Since
36343634
RFC5424 came out, as there has not been widespread deployment of it in syslog
@@ -3819,7 +3819,7 @@ then running the script results in
38193819
WARNING:demo:division by zero
38203820
38213821
As you can see, this output isn't ideal. That's because the underlying code
3822-
which writes to ``sys.stderr`` makes mutiple writes, each of which results in a
3822+
which writes to ``sys.stderr`` makes multiple writes, each of which results in a
38233823
separate logged line (for example, the last three lines above). To get around
38243824
this problem, you need to buffer things and only output log lines when newlines
38253825
are seen. Let's use a slghtly better implementation of ``LoggerWriter``:

Doc/library/cmath.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Power and logarithmic functions
8989
logarithms.
9090

9191

92-
.. function:: log(x[, base])
92+
.. function:: log(x, base=None)
9393

9494
Returns the logarithm of *x* to the given *base*. If the *base* is not
9595
specified, returns the natural logarithm of *x*. There is one branch cut, from 0

Doc/library/math.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -393,13 +393,12 @@ Power and logarithmic functions
393393
.. versionadded:: 3.2
394394

395395

396-
.. function:: log(x[, base])
396+
.. function:: log(x, base=None)
397397

398-
With one argument, return the natural logarithm of *x* (to base *e*).
399-
400-
With two arguments, return the logarithm of *x* to the given *base*,
401-
calculated as ``log(x)/log(base)``.
398+
Return the logarithm of *x* to the given *base*.
402399

400+
If the *base* is not specified, returns the natural
401+
logarithm (base *e*) of *x*.
403402

404403
.. function:: log1p(x)
405404

Doc/library/sqlite3.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2207,7 +2207,7 @@ This section shows recipes for common adapters and converters.
22072207
assert convert_datetime(b"2019-05-18T15:17:08.123456") == dt
22082208

22092209
# Using current time as fromtimestamp() returns local date/time.
2210-
# Droping microseconds as adapt_datetime_epoch truncates fractional second part.
2210+
# Dropping microseconds as adapt_datetime_epoch truncates fractional second part.
22112211
now = datetime.datetime.now().replace(microsecond=0)
22122212
current_timestamp = int(now.timestamp())
22132213

Doc/library/struct.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ In such cases, the ``@`` format character should be used to specify
462462
native byte ordering and data sizes. Internal pad bytes are normally inserted
463463
automatically. It is possible that a zero-repeat format code will be
464464
needed at the end of a format string to round up to the correct
465-
byte boundary for proper alignment of consective chunks of data.
465+
byte boundary for proper alignment of consecutive chunks of data.
466466

467467
Consider these two simple examples (on a 64-bit, little-endian
468468
machine)::

Doc/library/tarfile.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ be finalized; only the internally used file object will be closed. See the
279279
.. versionadded:: 3.2
280280
Added support for the context management protocol.
281281

282-
.. class:: TarFile(name=None, mode='r', fileobj=None, format=DEFAULT_FORMAT, tarinfo=TarInfo, dereference=False, ignore_zeros=False, encoding=ENCODING, errors='surrogateescape', pax_headers=None, debug=0, errorlevel=0)
282+
.. class:: TarFile(name=None, mode='r', fileobj=None, format=DEFAULT_FORMAT, tarinfo=TarInfo, dereference=False, ignore_zeros=False, encoding=ENCODING, errors='surrogateescape', pax_headers=None, debug=0, errorlevel=1)
283283

284284
All following arguments are optional and can be accessed as instance attributes
285285
as well.

Doc/using/windows.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ is printed. Now try changing the first line to be:
797797
Re-executing the command should now print the latest Python 3.x information.
798798
As with the above command-line examples, you can specify a more explicit
799799
version qualifier. Assuming you have Python 3.7 installed, try changing
800-
the first line to ``#! python3.7`` and you should find the |version|
800+
the first line to ``#! python3.7`` and you should find the 3.7
801801
version information printed.
802802

803803
Note that unlike interactive use, a bare "python" will use the latest

Include/cpython/longintrepr.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,14 @@ typedef long stwodigits; /* signed variant of twodigits */
7979
aware that ints abuse ob_size's sign bit.
8080
*/
8181

82-
struct _longobject {
83-
PyObject_VAR_HEAD
82+
typedef struct _PyLongValue {
83+
Py_ssize_t ob_size; /* Number of items in variable part */
8484
digit ob_digit[1];
85+
} _PyLongValue;
86+
87+
struct _longobject {
88+
PyObject_HEAD
89+
_PyLongValue long_value;
8590
};
8691

8792
PyAPI_FUNC(PyLongObject *) _PyLong_New(Py_ssize_t);

Include/cpython/pystate.h

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,30 @@ struct _ts {
119119
PyThreadState *next;
120120
PyInterpreterState *interp;
121121

122-
int _status;
122+
struct {
123+
/* Has been initialized to a safe state.
124+
125+
In order to be effective, this must be set to 0 during or right
126+
after allocation. */
127+
unsigned int initialized:1;
128+
129+
/* Has been bound to an OS thread. */
130+
unsigned int bound:1;
131+
/* Has been unbound from its OS thread. */
132+
unsigned int unbound:1;
133+
/* Has been bound aa current for the GILState API. */
134+
unsigned int bound_gilstate:1;
135+
/* Currently in use (maybe holds the GIL). */
136+
unsigned int active:1;
137+
138+
/* various stages of finalization */
139+
unsigned int finalizing:1;
140+
unsigned int cleared:1;
141+
unsigned int finalized:1;
142+
143+
/* padding to align to 4 bytes */
144+
unsigned int :24;
145+
} _status;
123146

124147
int py_recursion_remaining;
125148
int py_recursion_limit;
@@ -245,6 +268,8 @@ struct _ts {
245268
// Alias for backward compatibility with Python 3.8
246269
#define _PyInterpreterState_Get PyInterpreterState_Get
247270

271+
/* An alias for the internal _PyThreadState_New(),
272+
kept for stable ABI compatibility. */
248273
PyAPI_FUNC(PyThreadState *) _PyThreadState_Prealloc(PyInterpreterState *);
249274

250275
/* Similar to PyThreadState_Get(), but don't issue a fatal error

0 commit comments

Comments
 (0)