summaryrefslogtreecommitdiff
path: root/unotest
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-04-06 09:00:08 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-04-06 10:48:17 +0200
commit04f4702eb896a330bc3b10443b7303a1d07d7a11 (patch)
tree440c1d7686d1edeaf2ec47008f61674cf217d4e8 /unotest
parent36ad635381f9ea297bfbc6ed3e171ec8a5f0f785 (diff)
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 <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'unotest')
-rw-r--r--unotest/source/python/org/libreoffice/unotest.py7
1 files changed, 2 insertions, 5 deletions
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)]