Skip to content

Commit bb2ee62

Browse files
committed
Merge branch 'master' of https://github.com/geopython/OWSLib
2 parents ac8c414 + d3a06d3 commit bb2ee62

File tree

3 files changed

+35
-5
lines changed

3 files changed

+35
-5
lines changed

.github/workflows/windows.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: build on Windows ⚙️
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
main:
7+
runs-on: windows-latest
8+
strategy:
9+
matrix:
10+
python-version: ["3.11"]
11+
steps:
12+
- uses: actions/checkout@master
13+
- uses: actions/setup-python@v5
14+
name: Setup Python ${{ matrix.python-version }}
15+
with:
16+
python-version: ${{ matrix.python-version }}
17+
18+
- name: Install requirements 📦
19+
run: |
20+
pip install -e .
21+
pip install -r requirements.txt
22+
pip install -r requirements-dev.txt
23+
24+
- name: run tests ⚙️
25+
run: python -m pytest

owslib/wps.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@
118118
from owslib.namespaces import Namespaces
119119
from urllib.parse import urlparse
120120
import warnings
121+
import os
121122

122123
# namespace definition
123124
n = Namespaces()
@@ -1446,7 +1447,11 @@ def retrieveData(self, username=None, password=None, headers=None, verify=True,
14461447
# The link is a local file.
14471448
# Useful when running local tests during development.
14481449
if url.startswith("file://"):
1449-
with open(url[7:]) as f:
1450+
fn = url[7:]
1451+
# If on Windows and path starts with a '/', remove it
1452+
if os.name == 'nt' and fn.startswith('/'):
1453+
fn = fn[1:]
1454+
with open(fn) as f:
14501455
return f.read()
14511456

14521457
if '?' in url:

tests/test_iso3_parsing.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ def bmd():
302302
Source: https://metawal.wallonie.be/geonetwork
303303
"""
304304
belgian_sample = str(Path(__file__).parent.parent / "tests" / "resources" / "iso3_examples" / "metawal.wallonie.be-catchments.xml")
305-
with open(belgian_sample, "r") as f_d:
305+
with open(belgian_sample, "r", encoding="utf-8") as f_d:
306306
xml_list = f_d.readlines()
307307
xml_str = ''.join(xml_list)
308308
xml_bytes = bytes(xml_str, encoding='utf-8')
@@ -462,7 +462,7 @@ def amd():
462462
Source: https://portal.auscope.org.au/geonetwork
463463
"""
464464
aust_sample = str(Path(__file__).parent.parent / "tests" / "resources" / "iso3_examples" / "auscope-3d-model.xml")
465-
with open(aust_sample, "r") as f_d:
465+
with open(aust_sample, "r", encoding="utf-8") as f_d:
466466
xml_list = f_d.readlines()
467467
xml_str = ''.join(xml_list)
468468
xml_bytes = bytes(xml_str, encoding='utf-8')
@@ -518,7 +518,7 @@ def smd():
518518
Source: https://metawal.wallonie.be/geonetwork
519519
"""
520520
belgian_srv_sample = str(Path(__file__).parent.parent / "tests" / "resources" / "iso3_examples" / "metawal.wallonie.be-srv.xml")
521-
with open(belgian_srv_sample, "r") as f_d:
521+
with open(belgian_srv_sample, "r", encoding="utf-8") as f_d:
522522
xml_list = f_d.readlines()
523523
xml_str = ''.join(xml_list)
524524
xml_bytes = bytes(xml_str, encoding='utf-8')
@@ -554,7 +554,7 @@ def emd():
554554
Source: https://github.com/Esri/arcgis-pro-metadata-toolkit
555555
"""
556556
arcgis_sample = str(Path(__file__).parent.parent / "tests" / "resources" / "iso3_examples" / "arcgis-sample.xml")
557-
with open(arcgis_sample, "r") as f_d:
557+
with open(arcgis_sample, "r", encoding="utf-8") as f_d:
558558
xml_list = f_d.readlines()
559559
xml_str = ''.join(xml_list)
560560
xml_bytes = bytes(xml_str, encoding='utf-8')

0 commit comments

Comments
 (0)