Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitefb793c

Browse files
committed
Deploying to gh-pages from @bb185d8 🚀
1 parentdbe21a1 commitefb793c

File tree

576 files changed

+1824
-1610
lines changed

Some content is hidden

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

576 files changed

+1824
-1610
lines changed

‎_sources/c-api/codec.rst.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Codec registry and support functions
3939
*object* is passed through the decoder function found for the given
4040
*encoding* using the error handling method defined by *errors*. *errors* may
4141
be ``NULL`` to use the default method defined for the codec. Raises a
42-
:exc:`LookupError` if noencoder can be found.
42+
:exc:`LookupError` if nodecoder can be found.
4343
4444
4545
Codec lookup API

‎_sources/c-api/conversion.rst.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ The return value (*rv*) for these functions should be interpreted as follows:
4141
``rv + 1`` bytes would have been needed to succeed. ``str[size-1]`` is ``'\0'``
4242
in this case.
4343
44-
* When ``rv < 0``,"something bad happened." ``str[size-1]`` is ``'\0'`` in
44+
* When ``rv < 0``,the output conversion failed and ``str[size-1]`` is ``'\0'`` in
4545
this case too, but the rest of *str* is undefined. The exact cause of the error
4646
depends on the underlying platform.
4747

‎_sources/c-api/dict.rst.txt‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Dictionary Objects
5050
5151
..c:function::intPyDict_Contains(PyObject *p, PyObject *key)
5252
53-
Determine if dictionary *p* contains *key*. If an item in *p*ismatches
53+
Determine if dictionary *p* contains *key*. If an item in *p* matches
5454
*key*, return ``1``, otherwise return ``0``. On error, return ``-1``.
5555
This is equivalent to the Python expression ``key in p``.
5656
@@ -198,7 +198,7 @@ Dictionary Objects
198198
.. c:function:: int PyDict_Pop(PyObject *p, PyObject *key, PyObject **result)
199199
200200
Remove *key* from dictionary *p* and optionally return the removed value.
201-
Do not raise:exc:`KeyError` if the key missing.
201+
Do not raise:exc:`KeyError` if the keyismissing.
202202
203203
- If the key is present, set *\*result* to a new reference to the removed
204204
value if *result* is not ``NULL``, and return ``1``.
@@ -207,7 +207,7 @@ Dictionary Objects
207207
- On error, raise an exception and return ``-1``.
208208
209209
Similar to:meth:`dict.pop`, but without the default value and
210-
not raising:exc:`KeyError` if the key missing.
210+
not raising:exc:`KeyError` if the keyismissing.
211211
212212
..versionadded::3.13
213213

‎_sources/library/html.parser.rst.txt‎

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,18 @@
1515
This module defines a class:class:`HTMLParser` which serves as the basis for
1616
parsing text files formatted in HTML (HyperText Mark-up Language) and XHTML.
1717

18-
..class::HTMLParser(*, convert_charrefs=True)
18+
..class::HTMLParser(*, convert_charrefs=True, scripting=False)
1919

2020
Create a parser instance able to parse invalid markup.
2121

22-
If *convert_charrefs* is``True`` (the default), all character
23-
references (except the ones in ``script``/``style`` elements) are
22+
If *convert_charrefs* istrue (the default), all character
23+
references (except the ones inelements like``script`` and``style``) are
2424
automatically converted to the corresponding Unicode characters.
2525

26+
If *scripting* is false (the default), the content of the ``noscript``
27+
element is parsed normally; if it's true, it's returned as is without
28+
being parsed.
29+
2630
An:class:`.HTMLParser` instance is fed HTML data and calls handler methods
2731
when start tags, end tags, text, comments, and other markup elements are
2832
encountered. The user should subclass:class:`.HTMLParser` and override its
@@ -37,6 +41,9 @@ parsing text files formatted in HTML (HyperText Mark-up Language) and XHTML.
3741
..versionchanged::3.5
3842
The default value for argument *convert_charrefs* is now ``True``.
3943

44+
..versionchanged::3.14.1
45+
Added the *scripting* parameter.
46+
4047

4148
Example HTML Parser Application
4249
-------------------------------
@@ -161,24 +168,24 @@ implementations do nothing (except for :meth:`~HTMLParser.handle_startendtag`):
161168
..method::HTMLParser.handle_data(data)
162169

163170
This method is called to process arbitrary data (e.g. text nodes and the
164-
content of``<script>...</script>`` and ``<style>...</style>``).
171+
content ofelements like ``script`` and ``style``).
165172

166173

167174
..method::HTMLParser.handle_entityref(name)
168175

169176
This method is called to process a named character reference of the form
170177
``&name;`` (e.g. ``&gt;``), where *name* is a general entity reference
171-
(e.g. ``'gt'``). This method is never called if *convert_charrefs* is
172-
``True``.
178+
(e.g. ``'gt'``).
179+
This method is only called if *convert_charrefs* is false.
173180

174181

175182
..method::HTMLParser.handle_charref(name)
176183

177184
This method is called to process decimal and hexadecimal numeric character
178185
references of the form:samp:`&#{NNN};` and:samp:`&#x{NNN};`. For example, the decimal
179186
equivalent for ``&gt;`` is ``&#62;``, whereas the hexadecimal is ``&#x3E;``;
180-
in this case the method will receive ``'62'`` or ``'x3E'``. This method
181-
isnever called if *convert_charrefs* is``True``.
187+
in this case the method will receive ``'62'`` or ``'x3E'``.
188+
This methodisonly called if *convert_charrefs* isfalse.
182189

183190

184191
..method::HTMLParser.handle_comment(data)
@@ -292,8 +299,8 @@ Parsing an element with a few attributes and a title:
292299
Data : Python
293300
End tag : h1
294301

295-
The content of ``script`` and ``style``elementsis returned as is, without
296-
further parsing:
302+
The content ofelements like``script`` and ``style`` is returned as is,
303+
withoutfurther parsing:
297304

298305
..doctest::
299306

@@ -304,10 +311,10 @@ further parsing:
304311
End tag : style
305312

306313
>>>parser.feed('<script type="text/javascript">'
307-
...'alert("<strong>hello!</strong>");</script>')
314+
...'alert("<strong>hello! &#9786;</strong>");</script>')
308315
Start tag: script
309316
attr: ('type', 'text/javascript')
310-
Data : alert("<strong>hello!</strong>");
317+
Data : alert("<strong>hello! &#9786;</strong>");
311318
End tag : script
312319

313320
Parsing comments:
@@ -336,7 +343,7 @@ correct char (note: these 3 references are all equivalent to ``'>'``):
336343

337344
Feeding incomplete chunks to:meth:`~HTMLParser.feed` works, but
338345
:meth:`~HTMLParser.handle_data` might be called more than once
339-
(unless *convert_charrefs* isset to ``True``):
346+
if *convert_charrefs* isfalse:
340347

341348
..doctest::
342349

‎_sources/library/logging.rst.txt‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,12 +1082,13 @@ LoggerAdapter Objects
10821082
information into logging calls. For a usage example, see the section on
10831083
:ref:`adding contextual information to your logging output<context-info>`.
10841084

1085-
..class::LoggerAdapter(logger, extra, merge_extra=False)
1085+
..class::LoggerAdapter(logger, extra=None, merge_extra=False)
10861086

10871087
Returns an instance of:class:`LoggerAdapter` initialized with an
1088-
underlying:class:`Logger` instance, a dict-like object (*extra*), and a
1089-
boolean (*merge_extra*) indicating whether or not the *extra* argument of
1090-
individual log calls should be merged with the:class:`LoggerAdapter` extra.
1088+
underlying:class:`Logger` instance, an optional dict-like object (*extra*),
1089+
and an optional boolean (*merge_extra*) indicating whether or not
1090+
the *extra* argument of individual log calls should be merged with
1091+
the:class:`LoggerAdapter` extra.
10911092
The default behavior is to ignore the *extra* argument of individual log
10921093
calls and only use the one of the:class:`LoggerAdapter` instance
10931094

@@ -1127,9 +1128,13 @@ information into logging calls. For a usage example, see the section on
11271128
Attribute:attr:`!manager` and method:meth:`!_log` were added, which
11281129
delegate to the underlying logger and allow adapters to be nested.
11291130

1131+
..versionchanged::3.10
1132+
1133+
The *extra* argument is now optional.
1134+
11301135
..versionchanged::3.13
11311136

1132-
The *merge_extra*argument was added.
1137+
The *merge_extra*parameter was added.
11331138

11341139

11351140
Thread Safety

‎_sources/library/pyexpat.rst.txt‎

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ The :mod:`xml.parsers.expat` module contains two functions:
7272
*encoding* [1]_ is given it will override the implicit or explicit encoding of the
7373
document.
7474

75+
.. _xmlparser-non-root:
76+
77+
Parsers created through:func:`!ParserCreate` are called "root" parsers,
78+
in the sense that they do not have any parent parser attached. Non-root
79+
parsers are created by:meth:`parser.ExternalEntityParserCreate
80+
<xmlparser.ExternalEntityParserCreate>`.
81+
7582
Expat can optionally do XML namespace processing for you, enabled by providing a
7683
value for *namespace_separator*. The value must be a one-character string; a
7784
:exc:`ValueError` will be raised if the string has an illegal length (``None``
@@ -231,6 +238,55 @@ XMLParser Objects
231238
..versionadded::3.13
232239

233240

241+
:class:`!xmlparser` objects have the following methods to mitigate some
242+
common XML vulnerabilities.
243+
244+
..method::xmlparser.SetAllocTrackerActivationThreshold(threshold, /)
245+
246+
Sets the number of allocated bytes of dynamic memory needed to activate
247+
protection against disproportionate use of RAM.
248+
249+
By default, parser objects have an allocation activation threshold of 64 MiB,
250+
or equivalently 67,108,864 bytes.
251+
252+
An:exc:`ExpatError` is raised if this method is called on a
253+
|xml-non-root-parser| parser.
254+
The corresponding:attr:`~ExpatError.lineno` and:attr:`~ExpatError.offset`
255+
should not be used as they may have no special meaning.
256+
257+
..versionadded::next
258+
259+
..method::xmlparser.SetAllocTrackerMaximumAmplification(max_factor, /)
260+
261+
Sets the maximum amplification factor between direct input and bytes
262+
of dynamic memory allocated.
263+
264+
The amplification factor is calculated as ``allocated / direct``
265+
while parsing, where ``direct`` is the number of bytes read from
266+
the primary document in parsing and ``allocated`` is the number
267+
of bytes of dynamic memory allocated in the parser hierarchy.
268+
269+
The *max_factor* value must be a non-NaN:class:`float` value greater than
270+
or equal to 1.0. Amplification factors greater than 100.0 can be observed
271+
near the start of parsing even with benign files in practice. In particular,
272+
the activation threshold should be carefully chosen to avoid false positives.
273+
274+
By default, parser objects have a maximum amplification factor of 100.0.
275+
276+
An:exc:`ExpatError` is raised if this method is called on a
277+
|xml-non-root-parser| parser or if *max_factor* is outside the valid range.
278+
The corresponding:attr:`~ExpatError.lineno` and:attr:`~ExpatError.offset`
279+
should not be used as they may have no special meaning.
280+
281+
..note::
282+
283+
The maximum amplification factor is only considered if the threshold
284+
that can be adjusted by:meth:`.SetAllocTrackerActivationThreshold`
285+
is exceeded.
286+
287+
..versionadded::next
288+
289+
234290
:class:`xmlparser` objects have the following attributes:
235291

236292

@@ -954,3 +1010,4 @@ The ``errors`` module has the following attributes:
9541010
not. See https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl
9551011
and https://www.iana.org/assignments/character-sets/character-sets.xhtml.
9561012
1013+
.. |xml-non-root-parser|replace:::ref:`non-root<xmlparser-non-root>`

‎about.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ <h3>導航</h3>
314314
<ahref="https://www.python.org/psf/donations/">敬請捐贈。</a>
315315
<br>
316316
<br>
317-
最後更新於10月 27, 2025 (04:06 UTC)。
317+
最後更新於11月 03, 2025 (02:22 UTC)。
318318

319319
<ahref="/bugs.html">發現 bug</a>
320320

‎bugs.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ <h3>導航</h3>
351351
<ahref="https://www.python.org/psf/donations/">敬請捐贈。</a>
352352
<br>
353353
<br>
354-
最後更新於10月 27, 2025 (04:06 UTC)。
354+
最後更新於11月 03, 2025 (02:22 UTC)。
355355

356356
<ahref="/bugs.html">發現 bug</a>
357357

‎c-api/abstract.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ <h3>導航</h3>
323323
<ahref="https://www.python.org/psf/donations/">敬請捐贈。</a>
324324
<br>
325325
<br>
326-
最後更新於10月 27, 2025 (04:06 UTC)。
326+
最後更新於11月 03, 2025 (02:22 UTC)。
327327

328328
<ahref="/bugs.html">發現 bug</a>
329329

‎c-api/allocation.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ <h3>導航</h3>
432432
<ahref="https://www.python.org/psf/donations/">敬請捐贈。</a>
433433
<br>
434434
<br>
435-
最後更新於10月 27, 2025 (04:06 UTC)。
435+
最後更新於11月 03, 2025 (02:22 UTC)。
436436

437437
<ahref="/bugs.html">發現 bug</a>
438438

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp