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

Broken Import: handle strings with double quotes and strings with single-quote/comma #95

Open
rhodges opened this issue Oct 30, 2017 · 2 comments
Assignees
Labels
Milestone

Comments

@rhodges
Copy link
Member

rhodges commented Oct 30, 2017

single quotes are escaped with another single quote: "he'll" becomes "he''ll"

If that single quote (or apostrophe) is right before a comma, that breaks the current regex pattern:
eg_match = r'(E'".+?(?!\)"'|E'.*?(?!\)'|.+?)(?:,\s|$)'
import_sql near line 180

It also fails on strings with double quotes, which switch from:
E'I'm a string!'
to
E'I'm a "string"!'
so that it can be single quoted

@rhodges rhodges added the bug label Oct 30, 2017
@rhodges rhodges added this to the Final milestone Oct 30, 2017
@rhodges rhodges self-assigned this Oct 30, 2017
@rhodges
Copy link
Member Author

rhodges commented Oct 31, 2017

gave all str() functions "or ''" so 'NoneType' was never returned. Trying to str that was breaking everything.

@rhodges rhodges closed this as completed Oct 31, 2017
@rhodges
Copy link
Member Author

rhodges commented Nov 1, 2017

Here's an example to test against:
'E'There were things at place, (999) xx''x xx''xxx''x''9,'', "thing preposition verbed," but thing2 stuff, "new statement."', E'0', E'0', E'0''
should parse to [(string), "E'0'", E'0'", E'0'"] (len: 4)

@rhodges rhodges reopened this Nov 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant