Skip to content

Commit b213591

Browse files
committed
windows fixes
1 parent 30fd3f5 commit b213591

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

jupyter_core/tests/test_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def write_executable(path, source):
5656
import pkg_resources
5757

5858
w = pkg_resources.resource_string("setuptools", "cli-32.exe")
59-
except (ImportError, FileNotFoundError):
59+
except (ImportError, FileNotFoundError, SystemError):
6060
pytest.skip("Need pkg_resources/setuptools to make scripts executable on Windows")
6161
exe.write(w, "wb")
6262
exe.chmod(0o700)

jupyter_core/tests/test_paths.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,10 @@ def test_secure_write_win32():
417417
def fetch_win32_permissions(filename):
418418
"""Extracts file permissions on windows using icacls"""
419419
role_permissions = {}
420-
for index, line in enumerate(os.popen("icacls %s" % filename).read().splitlines()):
420+
proc = os.popen("icacls %s" % filename)
421+
lines = proc.read().splitlines()
422+
proc.close()
423+
for index, line in enumerate(lines):
421424
if index == 0:
422425
line = line.split(filename)[-1].strip().lower()
423426
match = re.match(r"\s*([^:]+):\(([^\)]*)\)", line)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ testpaths = [
3636
]
3737
filterwarnings= [
3838
# Fail on warnings
39-
"error"
39+
"error",
4040
]

0 commit comments

Comments
 (0)