Skip to content

Commit 59cdde8

Browse files
authored
Hashes in filenames (#299)
* Don't get confused by hashes in filenames.
1 parent b630de9 commit 59cdde8

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

cwltool/draft2tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from .utils import aslist
2626

2727
ACCEPTLIST_EN_STRICT_RE = re.compile(r"^[a-zA-Z0-9._+-]+$")
28-
ACCEPTLIST_EN_RELAXED_RE = re.compile(r"^[ a-zA-Z0-9._+-]+$") # with spaces
28+
ACCEPTLIST_EN_RELAXED_RE = re.compile(r"^[ #a-zA-Z0-9._+-]+$") # with spaces and hashes
2929
ACCEPTLIST_RE = ACCEPTLIST_EN_STRICT_RE
3030

3131
from .flatten import flatten

cwltool/resolver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ def tool_resolver(document_loader, uri):
2929
ret = r(document_loader, uri)
3030
if ret is not None:
3131
return ret
32-
return file_uri(os.path.abspath(uri))
32+
return file_uri(os.path.abspath(uri), split_frag=True)

cwltool/stdfsaccess.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import glob
22
import os
3+
import urllib
34

45
from schema_salad.ref_resolver import file_uri
56
from typing import BinaryIO, Text
@@ -30,7 +31,7 @@ def isdir(self, fn): # type: (Text) -> bool
3031
return os.path.isdir(self._abs(fn))
3132

3233
def listdir(self, fn): # type: (Text) -> List[Text]
33-
return [abspath(l, fn) for l in os.listdir(self._abs(fn))]
34+
return [abspath(urllib.quote(str(l)), fn) for l in os.listdir(self._abs(fn))]
3435

3536
def join(self, path, *paths): # type: (Text, *Text) -> Text
3637
return os.path.join(path, *paths)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
'ruamel.yaml >= 0.12.4',
5151
'rdflib >= 4.2.2, < 4.3.0',
5252
'shellescape >= 3.4.1, < 3.5',
53-
'schema-salad >= 2.2.20170216125639, < 3',
53+
'schema-salad >= 2.2.20170222151604, < 3',
5454
'typing >= 3.5.2, < 3.6'
5555
],
5656
setup_requires=[] + pytest_runner,

0 commit comments

Comments
 (0)