Python因为莫名其妙的原因而给出了KeyError

时间:2018-03-06 18:21:51

标签: python file-io pcap-ng

我收到这个错误,我在python中已经很长时间没有弄清楚了:

else

我正在调用我导入的另一个文件中的函数Traceback (most recent call last): File "st2110_parse_KB.py", line 173, in <module> section_header = get_pcapng_section_header(input_pcapng_file) File "Z:\easy_parse\pcapng.py", line 190, in get_pcapng_section_header assert(block_types[block_type] == "Section Header Block"), \ KeyError: 3569595041L

get_pcapng_section_header()

以下是我从主函数调用模块的方法:

from easy_parse.pcapng import *

以下是pcapng模块的片段:

#  input_pcapng_file = open("filename.pcap",'rb')

if filename:
  print "file works"
else:
  print "doesnt"

port_filter_str + '.payload'


print "its fine here"

section_header = get_pcapng_section_header(input_pcapng_file)

0 个答案:

没有答案