From 04f4702eb896a330bc3b10443b7303a1d07d7a11 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 6 Apr 2018 09:00:08 +0200 Subject: Fix Python file URL construction on Windows ...after d76281864b0e83812c0edf7490b1e8271e89fff5 "Create temp copies of test docs in Python/UITests" Change-Id: I4b6a5149c68f9e6cdc0a2037c07b50e8acc3623f Reviewed-on: https://gerrit.libreoffice.org/52486 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- unotest/source/python/org/libreoffice/unotest.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'unotest') diff --git a/unotest/source/python/org/libreoffice/unotest.py b/unotest/source/python/org/libreoffice/unotest.py index 1d0beb737ccb..222389af9e05 100644 --- a/unotest/source/python/org/libreoffice/unotest.py +++ b/unotest/source/python/org/libreoffice/unotest.py @@ -9,6 +9,7 @@ from __future__ import print_function +import pathlib import subprocess import time import uuid @@ -217,11 +218,7 @@ class UnoInProcess: return self.openDocFromAbsolutePath(path, asTemplate) def openDocFromAbsolutePath(self, file, asTemplate = False): - if os.name == "nt": - url = "file:///" + file - else: - url = "file://" + file - return self.openDocFromURL(url, asTemplate) + return self.openDocFromURL(pathlib.Path(file).as_uri(), asTemplate) def openDocFromURL(self, url, asTemplate = False): props = [("Hidden", True), ("ReadOnly", False), ("AsTemplate", asTemplate)] -- cgit v1.2.3