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

for python3 support #34

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

for python3 support #34

wants to merge 2 commits into from

Conversation

atomyuk
Copy link

@atomyuk atomyuk commented Jul 26, 2017

No description provided.

@@ -216,7 +216,7 @@ def write_to_csv(self):
if self.num_results > 0:
self.num_results = sum(1 for line in open(self.tmp_file, 'r'))
if self.num_results > 0:
output_file = open(self.opts.output_file, 'a')
output_file = open(self.opts.output_file, 'a', encoding='utf-8')
Copy link
Owner

Choose a reason for hiding this comment

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

Why we need this?

es2csv.py Outdated
@@ -234,7 +234,7 @@ def write_to_csv(self):
timer += 1
bar.update(timer)
line_as_dict = json.loads(line)
line_dict_utf8 = {k: v.encode('utf8') if isinstance(v, str) else v for k, v in line_as_dict.items()}
line_dict_utf8 = {k: v if isinstance(v, str) else v for k, v in line_as_dict.items()}
Copy link
Owner

Choose a reason for hiding this comment

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

Are we going to lose python2.7 support after this? Will unicode symbols be parsed correctly and wrote to file?

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.

2 participants