Author pitrou
Recipients belopolsky, doerwalter, ncoghlan, pitrou, vstinner
Date 2010-11-05.18:43:08
SpamBayes Score 1.88689e-05
Marked as misclassified No
Message-id <>
> I would be +0 on adding errors='replace' or 'backshlashreplace' to the 
> open() call in  write_results_file(), but hardcoding encoding="utf-8"
> is definitely not the right thing to do.

Who are the consumers of the trace files? Is there a formal specification or is Python the primary consumer?
If the former, then follow the specification (and/or amend it ;-)).
If the latter, you have the right to be creative; then utf-8 with the sounds like a most reasonable choice (possibly with an error handler such as "ignore" or "replace" to avoid barfing on lone surrogates).

Relying on the default encoding is not really a good idea, though. This is good for quick scripts or in the rare cases where it is by definition the expected behaviour. But in more elaborate cases you certainly want to decide the encoding by yourself.
Date User Action Args
2010-11-05 18:43:10pitrousetrecipients: + pitrou, doerwalter, ncoghlan, belopolsky, vstinner
2010-11-05 18:43:10pitrousetmessageid: <>
2010-11-05 18:43:08pitroulinkissue10329 messages
2010-11-05 18:43:08pitroucreate