Chrome native messaging doesn't accept messages of certain sizes (Windows)

两盒软妹~` 提交于 2019-12-01 10:34:53
Rob W

Since you're using Windows, I suspect that Windows is adding carriage returns (\x0D) to newline characters (\x0A).

According to Python 2.x - Write binary output to stdout?, a way to prevent modification of the output stream on Windows is to use the following snippet before writing anything to stdout.

if sys.platform == "win32":
    import os, msvcrt
    msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!