subprocess模块在Windows下调用失败问题

bug of python
http://bugs.python.org/issue1759845

解决:
print sys.stdout.encoding  #eg : it shows cp936
info = u'汉字'
cmd = 'echo ' + info
        
subprocess.call(["java", "-jar", "Test.jar", cmd.encode('cp936')], shell=True)

posted @ 2015-08-13 16:05  flowjacky  阅读(1096)  评论(0编辑  收藏  举报