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

Test Csv() on Backslash Escaped Strings #103

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kojiromike
Copy link
Contributor

@kojiromike kojiromike commented Dec 2, 2020

Test for #102

A regular expression is often written with backslash escapes. This change introduces a test to check that the Csv helper does not strip backslashes from input strings.

A regular expression is often written with backslash escapes.
This change introduces a test to check that the Csv helper does not
strip backslashes from input strings.
@@ -228,6 +228,7 @@ def __call__(self, value):
transform = lambda s: self.cast(s.strip(self.strip))

splitter = shlex(value, posix=True)
splitter.escape = '' # Do not escape backslashes
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@henriquebastos I want to call your attention to this line -- it fixes the issue for me, but may introduce backwards incompatibilities. I'm not sure if you have other users relying on this behavior. I would be happy with just this change, but let me know if you want me to introduce it via a new optional command arg or other backwards compatible change.

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.

None yet

1 participant