File tree Expand file tree Collapse file tree 4 files changed +14
-8
lines changed Expand file tree Collapse file tree 4 files changed +14
-8
lines changed Original file line number Diff line number Diff line change 11language : python
22python :
33- ' 2.7'
4+ - ' 3.5'
5+ - ' 3.6'
6+ - ' 3.7'
47before_install :
58- sudo apt-get update -qq
69- pip install toil[all]==3.17.0
Original file line number Diff line number Diff line change @@ -64,8 +64,8 @@ def testSupportedFormatChecking(self):
6464 for file_format , location in self .local .items ():
6565 if file_format != 'unsupported' :
6666 # Tests the behavior after receiving supported file types with and without the 'file://' prefix
67- self .assertEquals (wf_info (location ), self .expected [file_format ])
68- self .assertEquals (wf_info (location [7 :]), self .expected [file_format ])
67+ self .assertEqual (wf_info (location ), self .expected [file_format ])
68+ self .assertEqual (wf_info (location [7 :]), self .expected [file_format ])
6969
7070 else :
7171 # Tests behavior after receiving a non supported file type.
@@ -91,7 +91,7 @@ def testFileLocationChecking(self):
9191 wf_info (location )
9292
9393 else :
94- self .assertEquals (wf_info (location ), self .expected [file_format ])
94+ self .assertEqual (wf_info (location ), self .expected [file_format ])
9595 self .assertFalse (os .path .isfile (os .path .join (os .getcwd (), 'fetchedFromRemote.' + file_format )))
9696
9797
Original file line number Diff line number Diff line change 55import yaml
66import glob
77import requests
8- import urllib
98import logging
109
1110from wes_service .util import visit
12- from urllib import urlopen
11+
12+ from future .standard_library import hooks
13+
14+ with hooks ():
15+ from urllib .request import urlopen , pathname2url
1316
1417
1518def two_seven_compatible (filePath ):
@@ -56,7 +59,7 @@ def wf_info(workflow_path):
5659 html = urlopen (workflow_path ).read ()
5760 local_loc = os .path .join (os .getcwd (), 'fetchedFromRemote.' + file_type )
5861 with open (local_loc , 'w' ) as f :
59- f .write (html )
62+ f .write (html . decode () )
6063 version = wf_info ('file://' + local_loc )[0 ] # Don't take the file_type here, found it above.
6164 os .remove (local_loc ) # TODO: Find a way to avoid recreating file before version determination.
6265 else :
@@ -86,7 +89,7 @@ def fixpaths(d):
8689 if "path" in d :
8790 if ":" not in d ["path" ]:
8891 local_path = os .path .normpath (os .path .join (os .getcwd (), basedir , d ["path" ]))
89- d ["location" ] = urllib . pathname2url (local_path )
92+ d ["location" ] = pathname2url (local_path )
9093 else :
9194 d ["location" ] = d ["path" ]
9295 del d ["path" ]
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ def collect_attachments(self, run_id=None):
6767 content = v .read ()
6868 body [k ] = json .loads (content )
6969 else :
70- body [k ] = v .read ()
70+ body [k ] = v .read (). decode ()
7171
7272 if ":" not in body ["workflow_url" ]:
7373 body ["workflow_url" ] = "file://%s" % os .path .join (tempdir , secure_filename (body ["workflow_url" ]))
You can’t perform that action at this time.
0 commit comments