Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File paths can't have spaces #158

Closed
imolloy opened this issue Jan 6, 2022 · 2 comments
Closed

File paths can't have spaces #158

imolloy opened this issue Jan 6, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@imolloy
Copy link
Contributor

imolloy commented Jan 6, 2022

Describe the bug
A parsing error is thrown when a file path has a space in it

Details of the bug
GET process FROM file:///a/path/with/a space/in_the_name/bundle.json

Results in:

lark.exceptions.UnexpectedCharacters: No terminal matches 's' in the current parser context, .....
/a/path/with/a space/in_the_name/bundle.json`
                        ^
Expected on of:
                * WHERE

To Reproduce
Try to run GET on a file:// bundle with a space in the name

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: macOS 11.6
  • Python version: 3.7.7
  • Python install environment:
  • STIX-Shifter version: latest github develop branch.

Additional context
Add any other context about the problem here.

@imolloy imolloy added the bug Something isn't working label Jan 6, 2022
@subbyte subbyte added this to the Parser upgrade milestone Jan 6, 2022
@subbyte
Copy link
Member

subbyte commented Jan 6, 2022

Good catch! We don't have space in the syntax currently.

Since the command has more components after FROM, and we need to avoid confusion in case of /a/path/with/a where space/in_the_name/bundle.json. Some potential solutions:

  1. require escaping the space: /a/path/with/a\ where\ space/in_the_name/bundle.json
  2. use quotes: "/a/path/with/a where space/in_the_name/bundle.json"

@subbyte
Copy link
Member

subbyte commented Oct 18, 2022

confirmed fixed in v1.4.2 with test tests/test_parser.py::test_quoted_datasource

@subbyte subbyte closed this as completed Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants