TypeError: string argument without an encoding


学习分布式进程时该书用的python2.x,代码为
manager = QueueManager(address=('127.0.0.1', 8001), authkey='qiye')
运行报错TypeError: string argument without an encoding
在python3中此处需要把字符串转换为字节型
manager = QueueManager(address=('127.0.0.1', 8001), authkey=bytes('qiye', encoding='utf-8'))


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM