-
Notifications
You must be signed in to change notification settings - Fork 52
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
[Bug fix] Sanitize csv mails #453
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about products with " in the name
Hmm good point, i'll just have a google to see how others solve that as well, no way we have to consider everything :P I have tested it using mailhog like in #434, import csv
with open("Downloads/sales.csv") as file:
reader = csv.reader(file)
for row in reader:
print(row) the two issues i've mentioned is gone now at least |
@krestenlaust this should be covered now |
I have an alternative idea that i just tested, instead of having the rows_to_csv function we have now, we can go with your idea of using the csv library and mock a file class: import csv
class fakefile:
data = ""
def write(self, data):
self.data += data
def rows_to_csv(rows):
file = fakefile()
writer = csv.writer(file)
writer.writerows(rows)
return file.data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks promising, I have tested it yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in progress fix to unsanitized values in csv files, there are two issues atm