summaryrefslogtreecommitdiff
path: root/tests/write_abort_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/write_abort_test.py')
-rw-r--r--tests/write_abort_test.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/write_abort_test.py b/tests/write_abort_test.py
index f125fcb..6969af2 100644
--- a/tests/write_abort_test.py
+++ b/tests/write_abort_test.py
@@ -6,6 +6,7 @@ import os.path
import pycurl
import sys
import unittest
+import urllib.request
class WriteAbortTest(unittest.TestCase):
def setUp(self):
@@ -27,7 +28,8 @@ class WriteAbortTest(unittest.TestCase):
pass
# download the script itself through the file:// protocol into write_cb
- self.curl.setopt(pycurl.URL, 'file://' + os.path.abspath(__file__).replace('\\', '/'))
+ url = 'file:' + urllib.request.pathname2url(os.path.abspath(__file__))
+ self.curl.setopt(pycurl.URL, url)
self.curl.setopt(pycurl.WRITEFUNCTION, write_cb)
try:
self.curl.perform()