Kuang-che Wu <k...@csie.org> added the comment: > I fail to see why subprocess.call(cmd.encode('whatever')) is not a general > solution. Because 'whatever' encoding doesn't exist.
Assume cmd contains Japanese characters and my system is Chinese windows. subprocess.call expect the argument is encoded in mbcs, which is cp950. However, cp950 encoding doesn't contain Japanese characters. subprocess.call(cmd.encode('cp950')) will fail because cp950 doesn't contain Japanese characters. subprocess.call(cmd.encode('cp932')) will fail because subprocess.call will decode fail or incorrectly. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue1759845> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com