From 3a4f2eaccdccf11f43bb5721e4c8a5f588816a95 Mon Sep 17 00:00:00 2001 From: Alexander Piskun <13381981+bigcat88@users.noreply.github.com> Date: Thu, 1 Aug 2024 15:24:41 +0300 Subject: [PATCH] fixed `nc.files.makedirs` on Windows (#281) Reference: #280 Signed-off-by: Alexander Piskun --- CHANGELOG.md | 6 ++++++ nc_py_api/_version.py | 2 +- nc_py_api/files/files.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c132c74..3ed28a2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## [0.16.0 - 2024-08-xx] + +### Fixed + +- `nc.files.makedirs` not working properly on Windows. #280 Thanks to @Wuli6 + ## [0.15.1 - 2024-07-30] ### Fixed diff --git a/nc_py_api/_version.py b/nc_py_api/_version.py index 7d9f5aa9..8f0ef904 100644 --- a/nc_py_api/_version.py +++ b/nc_py_api/_version.py @@ -1,3 +1,3 @@ """Version of nc_py_api.""" -__version__ = "0.15.1" +__version__ = "0.16.0.dev0" diff --git a/nc_py_api/files/files.py b/nc_py_api/files/files.py index b1af2e90..3fd4e804 100644 --- a/nc_py_api/files/files.py +++ b/nc_py_api/files/files.py @@ -174,7 +174,7 @@ def makedirs(self, path: str | FsNode, exist_ok=False) -> FsNode | None: path = path.lstrip("/") result = None for i in Path(path).parts: - _path = os.path.join(_path, i) + _path = f"{_path}/{i}" if not exist_ok: result = self.mkdir(_path) else: