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

Unicode issue #15

Open
visch opened this issue Jul 15, 2022 · 0 comments · May be fixed by #16
Open

Unicode issue #15

visch opened this issue Jul 15, 2022 · 0 comments · May be fixed by #16

Comments

@visch
Copy link

visch commented Jul 15, 2022

2022-07-15T07:30:16.759125Z [info     ]   File "D:\AutoIDM\Job\.meltano\loaders\target-csv\venv\lib\site-packages\target_csv.py", line 97, in persist_messages cmd_type=elb consumer=True name=target-csv producer=False stdio=stderr string_id=target-csv
2022-07-15T07:30:16.764525Z [info     ]     writer.writerow(simplejson.loads(r)) cmd_type=elb consumer=True name=target-csv producer=False stdio=stderr string_id=target-csv
2022-07-15T07:30:16.770989Z [info     ]   File "C:\Python39\lib\csv.py", line 154, in writerow cmd_type=elb consumer=True name=target-csv producer=False stdio=stderr string_id=target-csv
2022-07-15T07:30:16.775307Z [info     ]     return self.writer.writerow(self._dict_to_list(rowdict)) cmd_type=elb consumer=True name=target-csv producer=False stdio=stderr string_id=target-csv
2022-07-15T07:30:16.779057Z [info     ]   File "C:\Python39\lib\encodings\cp1252.py", line 19, in encode cmd_type=elb consumer=True name=target-csv producer=False stdio=stderr string_id=target-csv
2022-07-15T07:30:16.783375Z [info     ]     return codecs.charmap_encode(input,self.errors,encoding_table)[0] cmd_type=elb consumer=True name=target-csv producer=False stdio=stderr string_id=target-csv
2022-07-15T07:30:16.794802Z [info     ] UnicodeEncodeError: 'charmap' codec can't encode character '\u0117' in position 83: character maps to <undefined> cmd_type=elb consumer=True name=target-csv producer=False stdio=stderr string_id=target-csv

Fixed by with open(filename, 'a', newline='', encoding='utf-8')

For some reason setting PYTHONIOENCODING="utf-8" doesn't work

@visch visch linked a pull request Jul 15, 2022 that will close this issue
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 a pull request may close this issue.

1 participant