From 0188ad8fd6e59f0ae85e713a713ecdffd27b75f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lum=C3=ADr=20=27Frenzy=27=20Balhar?= Date: Fri, 4 Aug 2023 09:18:21 +0200 Subject: [PATCH] Fix Python 3.12 compatibility (#6965) .joinpath with an empty argument no longer works as before thanks to this change in CPython: https://github.com/python/cpython/commit/cea910ebf14d1bd9d8bc0c8a5046e69ae8f5be17#diff-2e741d925220d74a9cc04cda1314d3649d9d189c0efc7db18e5387a51225b61c This change mimics the old internal behavior by using _paths attribute directly. --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 80ae8bf28a..c10ad325e4 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -91,7 +91,7 @@ def _make_notebook_app(**kwargs): ) # Copy the schema files. - test_data = str(files("jupyterlab_server.test_data").joinpath("")) + test_data = str(files("jupyterlab_server.test_data")._paths[0]) # type: ignore src = pathlib.PurePath(test_data, "schemas", "@jupyterlab") dst = pathlib.PurePath(str(schemas_dir), "@jupyterlab") if os.path.exists(dst):