Skip to content

Commit 1009813

Browse files
authored
Fix a SyntaxWarning caused by invalid escape sequences (jpadilla#1103)
The warning is thrown when Python imports the file, and manifests in the test suite with this error: ``` jwt/api_jwt.py:326 /home/runner/work/pyjwt/pyjwt/jwt/api_jwt.py:326: SyntaxWarning: invalid escape sequence '\*' (e.g. HS\* and RS\*). ``` (This manifests as a `DeprecationWarning` as well, depending on the Python interpreter and version.)
1 parent 3f9bcea commit 1009813

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Fixed
1616
- Validate `iss` claim is a string during encoding and decoding by @pachewise in `#1040 <https://github.com/jpadilla/pyjwt/pull/1040>`__
1717
- Improve typing/logic for `options` in decode, decode_complete by @pachewise in `#1045 <https://github.com/jpadilla/pyjwt/pull/1045>`__
1818
- Declare float supported type for lifespan and timeout by @nikitagashkov in `#1068 <https://github.com/jpadilla/pyjwt/pull/1068>`__
19+
- Fix ``SyntaxWarning``\s/``DeprecationWarning``\s caused by invalid escape sequences by @kurtmckee in `#1103 <https://github.com/jpadilla/pyjwt/pull/1103>`__
1920

2021
Added
2122
~~~~~

jwt/api_jwt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ def decode(
323323
configure it in the same place you configure the
324324
``key``. Make sure not to mix symmetric and asymmetric
325325
algorithms that interpret the ``key`` in different ways
326-
(e.g. HS\* and RS\*).
326+
(e.g. HS\\* and RS\\*).
327327
:type algorithms: typing.Sequence[str] or None
328328
329329
:param jwt.types.Options options: extended decoding and validation options

0 commit comments

Comments
 (0)