From b93934e51ff3d4d3f6494e565d1d8f25522b909c Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Thu, 19 Feb 2026 21:00:33 +0100 Subject: [PATCH 1/6] BUG: fix wrong handling of some windows network paths --- pyogrio/tests/test_path.py | 1 + pyogrio/util.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pyogrio/tests/test_path.py b/pyogrio/tests/test_path.py index e64d6c2f7..6940bd288 100644 --- a/pyogrio/tests/test_path.py +++ b/pyogrio/tests/test_path.py @@ -48,6 +48,7 @@ def change_cwd(path): ("file:///home/user/data.gpkg.zip", "/home/user/data.gpkg.zip"), ("file:///home/user/data.shp.zip", "/home/user/data.shp.zip"), ("/home/folder # with hash/data.gpkg", "/home/folder # with hash/data.gpkg"), + (r"\\server\!test\example.shp", r"\\server\!test\example.shp"), # cloud URIs ("https://testing/data.gpkg", "/vsicurl/https://testing/data.gpkg"), ("s3://testing/data.gpkg", "/vsis3/testing/data.gpkg"), diff --git a/pyogrio/util.py b/pyogrio/util.py index 0479df892..88f26c402 100644 --- a/pyogrio/util.py +++ b/pyogrio/util.py @@ -67,7 +67,9 @@ def vsi_path(path: str | Path) -> str: # Windows drive letters (e.g. "C:\") confuse `urlparse` as they look like # URL schemes - if sys.platform == "win32" and re.match("^[a-zA-Z]\\:", path): + if sys.platform == "win32" and ( + re.match("^[a-zA-Z]\\:", path) or path.startswith(r"\\") + ): # If it is not a zip file or it is multi-extension zip file that is directly # supported by a GDAL driver, return the path as is. if not path.split("!")[0].endswith(".zip"): From ca1a904147a25f0065b726a59490d70945c61d8b Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Thu, 19 Feb 2026 21:02:06 +0100 Subject: [PATCH 2/6] Update CHANGES.md --- CHANGES.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index d15472300..5659bb104 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,12 +1,18 @@ # CHANGELOG +## 0.12.2 (????-??-??) + +### Bug fixes + +- Fix wrong handling of some windows network paths (#). + ## 0.12.1 (2025-11-28) ### Bug fixes -- Fix regression in reading date columns (#616) +- Fix regression in reading date columns (#616). - Fix regression in `read_dataframe` when `use_arrow=True` and `columns` is used to filter - out columns of some specific types (#611) + out columns of some specific types (#611). ## 0.12.0 (2025-11-26) From 222d75bd736aebc97d20a036db3696a39f98f2e7 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Thu, 19 Feb 2026 21:19:47 +0100 Subject: [PATCH 3/6] Update CHANGES.md --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 5659bb104..eb28ffb1d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,7 +4,7 @@ ### Bug fixes -- Fix wrong handling of some windows network paths (#). +- Fix wrong handling of some windows network paths (#635). ## 0.12.1 (2025-11-28) From 3e4d06b4cf3ce84f8b7358db8c9ff0718d528671 Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Thu, 19 Feb 2026 21:26:45 +0100 Subject: [PATCH 4/6] Update test_path.py --- pyogrio/tests/test_path.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pyogrio/tests/test_path.py b/pyogrio/tests/test_path.py index 6940bd288..3fa4d68c2 100644 --- a/pyogrio/tests/test_path.py +++ b/pyogrio/tests/test_path.py @@ -1,5 +1,6 @@ import contextlib import os +import sys from pathlib import Path from zipfile import ZIP_DEFLATED, ZipFile @@ -48,7 +49,6 @@ def change_cwd(path): ("file:///home/user/data.gpkg.zip", "/home/user/data.gpkg.zip"), ("file:///home/user/data.shp.zip", "/home/user/data.shp.zip"), ("/home/folder # with hash/data.gpkg", "/home/folder # with hash/data.gpkg"), - (r"\\server\!test\example.shp", r"\\server\!test\example.shp"), # cloud URIs ("https://testing/data.gpkg", "/vsicurl/https://testing/data.gpkg"), ("s3://testing/data.gpkg", "/vsis3/testing/data.gpkg"), @@ -110,6 +110,18 @@ def test_vsi_path_unknown(): assert vsi_path("s4://test/data.geojson") == "s4://test/data.geojson" +@pytest.mark.parametrize( + "path, expected", + [ + (r"\\server\!test\example.shp", r"\\server\!test\example.shp"), + ], +) +@pytest.mark.skipif(not sys.platform.startswith("win"), reason="Windows specific test") +def test_vsi_path_windows(path, expected): + """Test for some specific Windows paths that only pass on Windows.""" + assert vsi_path(path) == expected + + def test_vsi_handling_read_functions(naturalearth_lowres_vsi): # test that all different read entry points have the path handling # (a zip:// path would otherwise fail) From eafff945394333412774a81310915279824620af Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Thu, 19 Feb 2026 21:30:41 +0100 Subject: [PATCH 5/6] Also test zip files --- pyogrio/tests/test_path.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyogrio/tests/test_path.py b/pyogrio/tests/test_path.py index 3fa4d68c2..65ccacfb9 100644 --- a/pyogrio/tests/test_path.py +++ b/pyogrio/tests/test_path.py @@ -114,6 +114,8 @@ def test_vsi_path_unknown(): "path, expected", [ (r"\\server\!test\example.shp", r"\\server\!test\example.shp"), + (r"\\server\!test\example.shp.zip", r"\\server\!test\example.shp.zip"), + (r"\\server\!test\example.zip", r"\\server\!test\example.zip"), ], ) @pytest.mark.skipif(not sys.platform.startswith("win"), reason="Windows specific test") From 62b144800987aab1d9686f39a4b699a2ad09794a Mon Sep 17 00:00:00 2001 From: Pieter Roggemans Date: Thu, 19 Feb 2026 21:31:16 +0100 Subject: [PATCH 6/6] Update test_path.py --- pyogrio/tests/test_path.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyogrio/tests/test_path.py b/pyogrio/tests/test_path.py index 65ccacfb9..2ce21dcf6 100644 --- a/pyogrio/tests/test_path.py +++ b/pyogrio/tests/test_path.py @@ -118,7 +118,7 @@ def test_vsi_path_unknown(): (r"\\server\!test\example.zip", r"\\server\!test\example.zip"), ], ) -@pytest.mark.skipif(not sys.platform.startswith("win"), reason="Windows specific test") +@pytest.mark.skipif(not sys.platform.startswith("win"), reason="Windows specific paths") def test_vsi_path_windows(path, expected): """Test for some specific Windows paths that only pass on Windows.""" assert vsi_path(path) == expected