In a command-line script, I think print consults sys.stdin.encoding to know what encoding to use to convert unicode arguments, so Mathieu’s simple fix would work in some cases (if stdout is a console, but not in a pipeline).