Use PYTHONIOENCODING=utf-8 for invites invocation

Since the send.py script for invites uses print to emit progress
including the names of contacts to which messages are sent,
redirecting stdout of the script to a local file can result in
encoding errors if some of the names include non-ASCII codepoints
(but not when stdout is your interactive terminal). Setting
PYTHONIOENCODING=utf-8 in the calling environment works around this
nicely.

Change-Id: I52b70c64f8b3a20da5143b31c5090192b0c75c99
This commit is contained in:
Jeremy Stanley 2017-03-06 20:57:26 +00:00
parent 97b50088dd
commit 6bfb87071e

View File

@ -15,10 +15,10 @@ You use it like this:
to escape them like ``... a $$600-off discount code ...`` so as to to escape them like ``... a $$600-off discount code ...`` so as to
avoid raising *ValueError: Invalid placeholder in string: line <X>, avoid raising *ValueError: Invalid placeholder in string: line <X>,
col <Y>* col <Y>*
- Run a test with ``python send.py atc_sample.csv codes_sample.csv`` - Run a test with ``PYTHONIOENCODING=utf-8 python send.py atc_sample.csv codes_sample.csv > sent_sample.csv``
Should work on stock Ubuntu. Should work on stock Ubuntu.
When ready, run the real thing with:: When ready, run the real thing with::
$ python send.py atc.csv codes.csv > sent.csv $ PYTHONIOENCODING=utf-8 python send.py atc.csv codes.csv > sent.csv