Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caucase
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
caucase
Commits
609921a3
Commit
609921a3
authored
Dec 30, 2024
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
caucase.test: Fix tarfile deprecation warning
parent
05515f9f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
caucase/test.py
caucase/test.py
+14
-2
No files found.
caucase/test.py
View file @
609921a3
...
...
@@ -84,6 +84,18 @@ from caucase.storage import SQLite3Storage
_cryptography_backend
=
default_backend
()
if
hasattr
(
tarfile
,
'data_filter'
):
# pragma: no cover
# Silence a deprecation warning on Python 3.12
class
TarFile
(
tarfile
.
TarFile
):
"""
tarball.TarFile with the future default filter.
Used to silence a deprecation warning.
"""
extraction_filter
=
staticmethod
(
tarfile
.
data_filter
)
else
:
# pragma: no cover
TarFile
=
tarfile
.
TarFile
def
_getTestOID
():
"""
Some cryptography versions do not tolerate large OIDs. Detect these here.
...
...
@@ -463,14 +475,14 @@ class CaucaseTest(TestCase):
self
.
_startServer
(
timeout
=
60
)
self
.
_stopServer
()
server_raw
=
BytesIO
()
with
tarfile
.
TarFile
(
mode
=
'w'
,
fileobj
=
server_raw
)
as
server_tarball
:
with
TarFile
(
mode
=
'w'
,
fileobj
=
server_raw
)
as
server_tarball
:
server_tarball
.
add
(
self
.
_server_dir
,
arcname
=
os
.
path
.
basename
(
self
.
_server_dir
),
)
_clean_caucased_snapshot
=
server_raw
.
getvalue
()
else
:
with
tarfile
.
TarFile
(
with
TarFile
(
mode
=
'r'
,
fileobj
=
BytesIO
(
_clean_caucased_snapshot
),
)
as
server_tarball
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment