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

Fix issue with parsing #1183

Merged
merged 3 commits into from
Feb 25, 2015
Merged

Fix issue with parsing #1183

merged 3 commits into from
Feb 25, 2015

Conversation

kyleknap
Copy link
Contributor

Issue was if there is a ] inside one of the values of a list, the end character would get removed. So something like foo=[bar, *[biz]*, bar] would get parsed to foo=bar,*[biz],bar. To get that to work, you would have to use escape characters.

Note that we still run into the issue where the argument is foo=[bar,[biz],bar], it will be translated to foo=bar,[biz,bar and the escape character would need to be used to get the correct format. To fix that, that will take a much larger change in how we parse input.

cc @jamesls @danielgtaylor

@coveralls
Copy link

Coverage Status

Coverage remained the same at 92.02% when pulling 26453f0 on kyleknap:splitting-quotes into 706ff5d on aws:develop.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 92.02% when pulling 26453f0 on kyleknap:splitting-quotes into 706ff5d on aws:develop.

@jamesls
Copy link
Member

jamesls commented Feb 25, 2015

:shipit:

Issue was if there is a ] inside one of the values of a list. The end character
would get removed. So something like ``foo=[bar, *[biz]*, bar]`` would
get parsed to ``foo=bar,*[biz],bar``.
@@ -85,7 +85,7 @@ def _eat_items(value, iter_parts, part, end_char, replace_char=''):
except StopIteration:
raise ValueError(value)
chunks.append(current.replace(replace_char, ''))
if end_char in current:
if end_char == current[-1]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't the line above replace some (and potentially all) characters with a blank? What happens when current is '' and we do the current[-1] check? May want to check for that case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danielgtaylor How does using endswith() sound?

@danielgtaylor
Copy link
Contributor

Thanks. 🚢-it!

kyleknap added a commit that referenced this pull request Feb 25, 2015
@kyleknap kyleknap merged commit 3568ce6 into aws:develop Feb 25, 2015
@kyleknap kyleknap deleted the splitting-quotes branch February 25, 2015 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants