This is the MarkupSafe 3.0.0 feature release. A feature release may include new features, remove previously deprecated code, add new deprecations, or introduce potentially breaking changes. The 3.0.x branch is now the supported fix branch, the 2.1.x branch will become a tag marking the end of support for that branch. We encourage everyone to upgrade, and to use a tool such as pip-tools to pin all dependencies and control upgrades. Test with warnings treated as errors to be able to adapt to deprecation warnings early.
Update signatures for Markup methods to match str signatures. Use positional-only arguments. #400
Some str methods on Markup no longer escape their argument: strip, lstrip, rstrip, removeprefix, removesuffix, partition, and rpartition; replace only escapes its new argument. These methods are conceptually linked to search methods such as in, find, and index, which already do not escape their argument. #401
The __version__ attribute is deprecated. Use feature detection, or importlib.metadata.version("markupsafe"), instead. #402
Support Python 3.13 and its experimental free-threaded build. :pr:461
Drop support for Python 3.7 and 3.8.
Use modern packaging metadata with pyproject.toml instead of setup.cfg.
:pr:348
Change distutils imports to setuptools. :pr:399
Use deferred evaluation of annotations. :pr:400
Update signatures for Markup methods to match str signatures. Use
positional-only arguments. :pr:400
Some str methods on Markup no longer escape their argument:
strip, lstrip, rstrip, removeprefix, removesuffix,
partition, and rpartition; replace only escapes its new
argument. These methods are conceptually linked to search methods such as
in, find, and index, which already do not escape their argument.
:issue:401
The __version__ attribute is deprecated. Use feature detection, or
importlib.metadata.version("markupsafe"), instead. :pr:402
Fixed a regression introduced in pyparsing 3.1.3, addition of a type annotation that
referenced re.Pattern. Since this type was introduced in Python 3.7, using this type
definition broke Python 3.6 installs of pyparsing 3.1.3. PR submitted by Felix Fontein,
nice work!
Version 3.1.3 - August, 2024
Added new Tag ParserElement, for inserting metadata into the parsed results.
This allows a parser to add metadata or annotations to the parsed tokens.
The Tag element also accepts an optional value parameter, defaulting to True.
See the new tag_metadata.py example in the examples directory.
result = greeting.parse_string("Hello World.")
print(result.dump())
result = greeting.parse_string("Hello World!")
print(result.dump())
prints:
['Hello', 'World', '.']
['Hello', 'World', '!']
enthusiastic: True
Added example mongodb_query_expression.py, to convert human-readable infix query
expressions (such as a==100 and b>=200) and transform them into the equivalent
query argument for the pymongo package ({'$and': [{'a': 100}, {'b': {'$gte': 200}}]}).
Supports many equality and inequality operators - see the docstring for the
transform_query function for more examples.
Fixed issue where PEP8 compatibility names for ParserElement static methods were
not themselves defined as staticmethods. When called using a ParserElement instance,
this resulted in a TypeError exception. Reported by eylenburg (#548).
To address a compatibility issue in RDFLib, added a property setter for the
ParserElement.name property, to call ParserElement.set_name.
Modified ParserElement.set_name() to accept a None value, to clear the defined
name and corresponding error message for a ParserElement.
urllib3 is raising ~$40,000 USD to release HTTP/2 support and ensure long-term sustainable maintenance of the project after a sharp decline in financial support for 2023. If your company or organization uses Python and would benefit from HTTP/2 support in Requests, pip, cloud SDKs, and thousands of other projects please consider contributing financially to ensure HTTP/2 support is developed sustainably and maintained for the long-haul.
Fixed the default encoding of chunked request bodies to be UTF-8 instead of ISO-8859-1. All other methods of supplying a request body already use UTF-8 starting in urllib3 v2.0. (#3053)
Added support for Python 3.13. ([#3473](https://github.com/urllib3/urllib3/issues/3473) <https://github.com/urllib3/urllib3/issues/3473>__)
Bugfixes
Fixed the default encoding of chunked request bodies to be UTF-8 instead of ISO-8859-1.
All other methods of supplying a request body already use UTF-8 starting in urllib3 v2.0. ([#3053](https://github.com/urllib3/urllib3/issues/3053) <https://github.com/urllib3/urllib3/issues/3053>__)
Fixed ResourceWarning on CONNECT with Python `__)
Adjust tolerance for floating-point comparison on Windows to avoid flakiness in CI ([#3413](https://github.com/urllib3/urllib3/issues/3413) <https://github.com/urllib3/urllib3/issues/3413>__)
Fixed a crash where certain standard library hash functions were absent in restricted environments. ([#3432](https://github.com/urllib3/urllib3/issues/3432) <https://github.com/urllib3/urllib3/issues/3432>__)
Fixed mypy error when adding to HTTPConnection.default_socket_options. ([#3448](https://github.com/urllib3/urllib3/issues/3448) <https://github.com/urllib3/urllib3/issues/3448>__)
HTTP/2 (experimental)
HTTP/2 support is still in early development.
Excluded Transfer-Encoding: chunked from HTTP/2 request body ([#3425](https://github.com/urllib3/urllib3/issues/3425) <https://github.com/urllib3/urllib3/issues/3425>__)
Now only accepting supported h2 major version 4.x.x. ([#3290](https://github.com/urllib3/urllib3/issues/3290) <https://github.com/urllib3/urllib3/issues/3290>__)
Added a probing mechanism for determining whether a given target origin
supports HTTP/2 via ALPN. ([#3301](https://github.com/urllib3/urllib3/issues/3301) <https://github.com/urllib3/urllib3/issues/3301>__)
Add support for sending a request body with HTTP/2 ([#3302](https://github.com/urllib3/urllib3/issues/3302) <https://github.com/urllib3/urllib3/issues/3302>__)
Deprecations and Removals
Note for downstream distributors: the _version.py file has been removed and is now created at build time by hatch-vcs. ([#3412](https://github.com/urllib3/urllib3/issues/3412) <https://github.com/urllib3/urllib3/issues/3412>__)
Drop support for end-of-life PyPy3.8 and PyPy3.9. ([#3475](https://github.com/urllib3/urllib3/issues/3475) <https://github.com/urllib3/urllib3/issues/3475>__)
Restore behavior where parsing multipart/x-www-form-urlencoded data with
invalid UTF-8 bytes in the body results in no form data parsed rather than a
413 error. #2930
Improve parse_options_header performance when parsing unterminated
quoted string values. #2904
Debugger pin auth is synchronized across threads/processes when tracking
failed entries. #2916
Dev server handles unexpected SSLEOFError due to issue in Python < 3.13.
#2926
Debugger pin auth works when the URL already contains a query string.
#2918
Restore behavior where parsing multipart/x-www-form-urlencoded data with
invalid UTF-8 bytes in the body results in no form data parsed rather than a
413 error. :issue:2930
Improve parse_options_header performance when parsing unterminated
quoted string values. :issue:2904
Debugger pin auth is synchronized across threads/processes when tracking
failed entries. :issue:2916
Dev server handles unexpected SSLEOFError due to issue in Python < 3.13.
:issue:2926
Debugger pin auth works when the URL already contains a query string.
:issue:2918
permit Transfer-Encoding headers specifying multiple encodings. note: no parameters, still (:pr:3261)
sdist generation now explicitly excludes sphinx build folder (:pr:3257)
decode bytes-typed status (as can be passed by gevent) as utf-8 instead of raising TypeError (:pr:2336)
raise correct Exception when encounting invalid chunked requests (:pr:3258)
the SCRIPT_NAME and PATH_INFO headers, when received from allowed forwarders, are no longer restricted for containing an underscore (:pr:3192)
include IPv6 loopback address [::1] in default for :ref:forwarded-allow-ips and :ref:proxy-allow-ips (:pr:3192)
** NOTE **
The SCRIPT_NAME change mitigates a regression that appeared first in the 22.0.0 release
Review your :ref:forwarded-allow-ips setting if you are still not seeing the SCRIPT_NAME transmitted
Review your :ref:forwarder-headers setting if you are missing headers after upgrading from a version prior to 22.0.0
** Breaking changes **
refuse requests where the uri field is empty (:pr:3255)
refuse requests with invalid CR/LR/NUL in heade field values (:pr:3253)
remove temporary --tolerate-dangerous-framing switch from 22.0 (:pr:3260)
If any of the breaking changes affect you, be aware that now refused requests can post a security problem, especially so in setups involving request pipe-lining and/or proxies.
#12446: Avoid calling @property (and other instance descriptors) during fixture discovery -- by asottile{.interpreted-text role="user"}
#12659: Fixed the issue of not displaying assertion failure differences when using the parameter --import-mode=importlib in pytest>=8.1.
#12667: Fixed a regression where type change in [ExceptionInfo.errisinstance]{.title-ref} caused [mypy]{.title-ref} to fail.
#12744: Fixed typing compatibility with Python 3.9 or less -- replaced [typing.Self]{.title-ref} with [typing_extensions.Self]{.title-ref} -- by Avasam{.interpreted-text role="user"}
#12745: Fixed an issue with backslashes being incorrectly converted in nodeid paths on Windows, ensuring consistent path handling across environments.
#6682: Fixed bug where the verbosity levels where not being respected when printing the "msg" part of failed assertion (as in assert condition, msg).
#9422: Fix bug where disabling the terminal plugin via -p no:terminal would cause crashes related to missing the verbose option.
-- by GTowers1{.interpreted-text role="user"}
Improved documentation
#12663: Clarify that the [pytest_deselected]{.title-ref} hook should be called from [pytest_collection_modifyitems]{.title-ref} hook implementations when items are deselected.
#12678: Remove erroneous quotes from [tmp_path_retention_policy]{.title-ref} example in docs.
Miscellaneous internal changes
#12769: Fix typos discovered by codespell and add codespell to pre-commit hooks.
Commits
d0f136f build(deps): Bump pypa/gh-action-pypi-publish from 1.10.0 to 1.10.1 (#12790)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
- `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
- `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency
- `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
Bumps the python group with 13 updates in the / directory:
2024.7.4
2024.8.30
3.7
3.10
2.1.5
3.0.0
3.1.2
3.1.4
2.2.2
2.2.3
3.0.3
3.0.4
3.19.2
3.20.2
22.0.0
23.0.0
8.3.2
8.3.3
3.2.6
3.3.1
1.7.9
1.7.10
1.11.1
1.11.2
71.1.0.20240806
75.1.0.20240917
Updates
certifi
from 2024.7.4 to 2024.8.30Commits
325c2fd
2024.08.30 (#304)d66bf5f
Bump actions/upload-artifact from 4.3.5 to 4.3.6 (#302)2150f23
Bump actions/upload-artifact from 4.3.4 to 4.3.5 (#301)fc9b771
Bump actions/setup-python from 5.1.0 to 5.1.1 (#300)965b239
Bump actions/download-artifact from 4.1.7 to 4.1.8 (#297)c1f50cc
Bump actions/upload-artifact from 4.3.3 to 4.3.4 (#296)Updates
idna
from 3.7 to 3.10Release notes
Sourced from idna's releases.
Changelog
Sourced from idna's changelog.
Commits
729225d
Release v3.103eef168
Merge pull request #194 from kjd/revert-unicode-16ceca619
Revert Unicode 16.0.0 data updatesc43ac75
Merge pull request #191 from kjd/release-3.91b8800a
Release v3.9a1fd168
Merge pull request #190 from kjd/unicode-167732c61
Merge branch 'master' into unicode-164ed183d
Refactor membership test762216b
Format with ruff580ece9
Implement changes to UTS46 algorithmUpdates
markupsafe
from 2.1.5 to 3.0.0Release notes
Sourced from markupsafe's releases.
Changelog
Sourced from markupsafe's changelog.
Commits
7643710
release version 3.0.044a54cd
Build Python 3.13 wheels (#461)0a00cfe
style changesb6ff4ad
update CHANGES.rst9f8bcee
Merge branch 'main' into cp313402311d
update dev dependenciesf56c105
drop support for python 3.8 (#464)9372f38
drop support for python 3.827a2e43
Usesys._is_gil_enabled()
cefaed9
Report Py_GIL_DISABLED config in pytest outputUpdates
pyparsing
from 3.1.2 to 3.1.4Changelog
Sourced from pyparsing's changelog.
... (truncated)
Commits
b846e4a
Prep for 3.1.4 release9bd2356
Add Python 3.6 to CI (#566)ee50a19
Add Tag notes to HowToUsePyparsing.rst3ffc3ef
Fix typoe5e97f7
Add mongodb_query_expression.py to examples; updated 0README.html and test_ex...10cef98
Add Tag ParserElement classcf41d90
Prep for 3.1.3 released7c163c
Some minor code changes in chemical_formulas.pyeb56030
Various code cleanupsa9e7d47
Added name property setter, and enhanced set_name() to accept a None value to...Updates
urllib3
from 2.2.2 to 2.2.3Release notes
Sourced from urllib3's releases.
Changelog
Sourced from urllib3's changelog.
Commits
2458bfc
Release 2.2.39b25db6
Only attempt to publish for upstreamb9adeef
Drop support for EOL PyPy3.8 and PyPy3.9b1d4649
Add explicit support for Python 3.13cc42860
Bump cryptography from 42.0.4 to 43.0.1 (#3470)3dae2e9
Bump pypa/gh-action-pypi-publish from 1.9.0 to 1.10.1 (#3469)1e94feb
Revert "Add TLS settings for HTTP/2 (#3456)" (#3466)aa73abc
Bump actions/setup-python from 5.1.0 to 5.2.0 (#3468)abbfbcb
Add 1.26.20 to changelog and make the publish workflow the same (#3464)d480615
Add TLS settings for HTTP/2 (#3456)Updates
werkzeug
from 3.0.3 to 3.0.4Release notes
Sourced from werkzeug's releases.
Changelog
Sourced from werkzeug's changelog.
Commits
b933ccb
release version 3.0.4c09de73
debugger works on urls with query string (#2942)1d1d987
debugger works on urls with query string32a77a0
treat SSLEOFError as dropped connection (#2941)cf18d03
treat SSLEOFError as dropped connectiona1db120
synchronize failed pin entry (#2940)6504819
synchronize failed pin entry7abec4b
improve parse_options_header performance (#2939)3a893d2
improve parse_options_header performance3a52597
restore invalid bytes behavior for form parser (#2938)Updates
zipp
from 3.19.2 to 3.20.2Changelog
Sourced from zipp's changelog.
Commits
a575660
Make no assertions about the number. It could be negative.0b3a1b9
Finalizea4c7961
Make zipp.compat.overlay.zipfile hashable.d66007a
Merge https://github.com/jaraco/skeleton3fe8c5b
jaraco/skeleton#146
81b766c
Fix an incompatibility (and source of merge conflicts) with projects using Ru...b8a63ca
Merge pull request #125 from saschanaz/patch-10b95ec7
Suppress F8215d2fa66
Merge https://github.com/jaraco/skeletona675458
Allow the workflow to be triggered manually.Updates
gunicorn
from 22.0.0 to 23.0.0Release notes
Sourced from gunicorn's releases.
Commits
411986d
fix doc334392e
Merge pull request #2559 from laggardkernel/bugfix/reexec-enve75c353
Merge pull request #3189 from pajod/patch-py369357b28
keep document user in access_log_format setting79fdef0
bump to 23.0.03acd9fb
Merge pull request #2620 from talkerbox/improve-access-log-format-docs3f56d76
Merge pull request #3192 from pajod/patch-allowed-script-name256d474
docs: revert duped directiveffa48b5
test: default change was intentional52538ca
docs: recommend SCRIPT_NAME=/subfolderUpdates
pytest
from 8.3.2 to 8.3.3Release notes
Sourced from pytest's releases.
Commits
d0f136f
build(deps): Bump pypa/gh-action-pypi-publish from 1.10.0 to 1.10.1 (#12790)972f307
Prepare release version 8.3.30dabdcf
Include co-authors in release announcement (#12795) (#12797)a9910a4
Do not discover properties when iterating fixtures (#12781) (#12788)0f10b6b
Fix issue with slashes being turned into backslashes on Windows (#12760) (#12...300d13d
Merge pull request #12785 from pytest-dev/patchback/backports/8.3.x/57cccf7f4...e5d32c7
Merge pull request #12784 from svenevs/fix/docs-example-parametrize-minor-typobc913d1
Streamline checks for verbose option (#12706) (#12778)01cfcc9
Fix typos and introduce codespell pre-commit hook (#12769) (#12774)4873394
doc: Remove past training (#12772) (#12773)Updates
pylint
from 3.2.6 to 3.3.1Commits
76bce72
Bump pylint to 3.3.1, update changelog (#9954)55ee816
Bump astroid to 3.3.4 (#9951) (#9952)6350dfa
Bump pylint to 3.3.0, update changelog78f3dfa
Bump astroid to 3.3.3 (#9939)b28c1f6
Add check forunnecessary-default-type-args
(#9938)bd97b93
[doc framework] Assert that the good and bad example exists in the doc (#9936)7aa4436
Fix duplicate workflow step ids (#9934)0950916
[pre-commit] Add codespell, and fix some existing typos (#9912)3b4a7f9
Add details.rst for c-extension-no-member (#9933)7d60c27
Explicitly save cache in primer jobsUpdates
bandit
from 1.7.9 to 1.7.10Release notes
Sourced from bandit's releases.
Commits
36fd650
Pytorch Load / Save Plugin (#1114)4ac55df
Use consistent file naming of docs (#1170)68022aa
Bump docker/build-push-action from 6.6.1 to 6.7.0 (#1168)77566a0
Bump sigstore/cosign-installer from 3.5.0 to 3.6.0 (#1165)221ced6
Bump docker/build-push-action from 6.5.0 to 6.6.1 (#1166)701b7d5
Bump docker/setup-buildx-action from 3.5.0 to 3.6.1 (#1163)320495c
Bump docker/build-push-action from 6.3.0 to 6.5.0 (#1160)90490c7
Bump docker/login-action from 3.2.0 to 3.3.0 (#1159)708ab74
Bump docker/setup-buildx-action from 3.4.0 to 3.5.0 (#1158)89d2345
Bump docker/setup-buildx-action from 3.3.0 to 3.4.0 (#1156)Updates
mypy
from 1.11.1 to 1.11.2Commits
789f02c
Bump version to 1.11.2917cc75
An alternative fix for a union-like literal string (#17639)7d805b3
Unwrap TypedDict item types before storing (#17640)32675dd
Revert "Fix Literal strings containing pipe characters" (#17638)778542b
Revert "FixRawExpressionType.accept
crash with--cache-fine-grained
" (#1...14ab742
Bump version to 1.11.2+devUpdates
types-setuptools
from 71.1.0.20240806 to 75.1.0.20240917Commits
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show