struct.error: unpack requires a buffer of 136 bytes@TOC
使用树莓派向linux服务器传输照片时,struct.error: unpack requires a buffer of 136 bytes
原因是树莓派系统为32位,而服务器系统为64位。
因此需要在打包时
fhead = struct.pack(‘128sq’, bytes(os.path.basename(filepath),encoding=‘utf-8’),os.stat(filepath).st_size)
使用128sq而不是128sl。在64位服务器中解包时仍使用128sl即可解决
链接: https://blog.csdn.net/zsy162534/article/details/83991785.