Skip to content

Commit

Permalink
Merge pull request #415 from Crunch-io/strip-path-validation
Browse files Browse the repository at this point in the history
Remove Path() char validation, #377
  • Loading branch information
xbito authored Sep 2, 2021
2 parents 7361a85 + 2993e76 commit ffcb6f4
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 15 deletions.
10 changes: 0 additions & 10 deletions scrunch/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@ def __init__(self, path):
if not isinstance(path, six.string_types):
raise TypeError('The path must be a string object')

if six.PY2:
regex_match = re.match(NAME_REGEX, path.decode('utf-8'))
else:
regex_match = re.match(NAME_REGEX, path)

if not regex_match:
raise InvalidPathError(
'Invalid path %s: it contains invalid characters.' % path
)

self.path = path

@property
Expand Down
4 changes: 0 additions & 4 deletions scrunch/tests/test_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,6 @@ def test_path(self):
Path(1234)
assert str(excinfo.value) == 'The path must be a string object'

with pytest.raises(InvalidPathError) as excinfo:
Path('|If Skadeförsäkring')
assert str(excinfo.value) == 'Invalid path |If Skadeförsäkring: it contains invalid characters.'

Path('|If Skadeförsäkring')
Path('|æøå')

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
'pycrunch>=0.4.11',
'requests',
'six',
'cr.cube',
'cr.cube==2.3.9',
'importlib_metadata',
],
extras_require={
Expand Down

0 comments on commit ffcb6f4

Please sign in to comment.