From ced69f34731bb614691bee615bddc0ff07f6c98e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81tienne=20Hossack?= Date: Sat, 13 Jan 2024 16:31:58 -0800 Subject: [PATCH] fix invalid escape sequences (python 3.12 SyntaxWarning) --- b2sdk/file_version.py | 2 +- b2sdk/raw_simulator.py | 2 +- b2sdk/v2/file_version.py | 2 +- changelog.d/458.fixed.md | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 changelog.d/458.fixed.md diff --git a/b2sdk/file_version.py b/b2sdk/file_version.py index 3b6388530..dc2ca9728 100644 --- a/b2sdk/file_version.py +++ b/b2sdk/file_version.py @@ -219,7 +219,7 @@ class FileVersion(BaseFileVersion): """ A structure which represents a version of a file (in B2 cloud). - :ivar str ~.id\_: ``fileId`` + :ivar str ~.id_: ``fileId`` :ivar str ~.file_name: full file name (with path) :ivar ~.size: size in bytes, can be ``None`` (unknown) :ivar str ~.content_type: RFC 822 content type, for example ``"application/octet-stream"`` diff --git a/b2sdk/raw_simulator.py b/b2sdk/raw_simulator.py index 17d7973cf..2a4cfbdf1 100644 --- a/b2sdk/raw_simulator.py +++ b/b2sdk/raw_simulator.py @@ -1159,7 +1159,7 @@ class RawSimulator(AbstractRawApi): DOWNLOAD_URL_MATCHER = re.compile( DOWNLOAD_URL + '(?:' + '|'.join( ( - '/b2api/v[0-9]+/b2_download_file_by_id\?fileId=(?P[^/]+)', + r'/b2api/v[0-9]+/b2_download_file_by_id\?fileId=(?P[^/]+)', '/file/(?P[^/]+)/(?P.+)', ) ) + ')$' diff --git a/b2sdk/v2/file_version.py b/b2sdk/v2/file_version.py index 51599ea8d..db800d216 100644 --- a/b2sdk/v2/file_version.py +++ b/b2sdk/v2/file_version.py @@ -27,7 +27,7 @@ class FileVersion(v3.FileVersion): """ A structure which represents a version of a file (in B2 cloud). - :ivar str ~.id\_: ``fileId`` + :ivar str ~.id_: ``fileId`` :ivar str ~.file_name: full file name (with path) :ivar ~.size: size in bytes, can be ``None`` (unknown) :ivar str ~.content_type: RFC 822 content type, for example ``"application/octet-stream"`` diff --git a/changelog.d/458.fixed.md b/changelog.d/458.fixed.md new file mode 100644 index 000000000..ca247dabf --- /dev/null +++ b/changelog.d/458.fixed.md @@ -0,0 +1 @@ +Fix escape sequence warnings present in python 3.12. \ No newline at end of file