Author kcwu
Recipients amaury.forgeotdarc, andersjm, brotch, gregcouch, kcwu, mclausch, mightyiam, ocean-city, terry.reedy, xianyiteng
Date 2010-08-04.07:11:28
SpamBayes Score 4.75429e-06
Marked as misclassified No
Message-id <1280905890.73.0.0702096025379.issue1759845@psf.upfronthosting.co.za>
In-reply-to
Content
> 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.
History
Date User Action Args
2010-08-04 07:11:37kcwusetrecipients: + kcwu, terry.reedy, amaury.forgeotdarc, gregcouch, andersjm, ocean-city, mclausch, brotch, xianyiteng, mightyiam
2010-08-04 07:11:30kcwusetmessageid: <1280905890.73.0.0702096025379.issue1759845@psf.upfronthosting.co.za>
2010-08-04 07:11:29kcwulinkissue1759845 messages
2010-08-04 07:11:28kcwucreate