小编use*_*841的帖子

DeprecationWarning:不建议使用struct integer overflow masking

我有以下问题.代码如下:

import  binascii, struct
def crc32up(data):
    # little endian!!
    bin = struct.pack ('<I', binascii.crc32 (data))
    return string.upper (binascii.hexlify (bin))

# Generate crc of time code.
#
timecrc_code = crc32up(time_code)
Run Code Online (Sandbox Code Playgroud)

并且警告是:

 DeprecationWarning: struct integer overflow masking is deprecated
 timecrc_code = crc32up(time_code)
Run Code Online (Sandbox Code Playgroud)

导致此错误的原因是什么?

python struct

1
推荐指数
1
解决办法
3734
查看次数

标签 统计

python ×1

struct ×1