报了这个错:
Traceback (most recent call last):
File “/Users/Shared/CD:DVD_EXTRACT_NEW/read_sk.py”, line 127, in
extract_files(‘/Users/Shared/Longman Word Wise Dictionary/’, ‘/Users/Shared/extracted-lwwd/’)
File “/Users/Shared/CD:DVD_EXTRACT_NEW/read_sk.py”, line 91, in extract_files
files_config = read_cft(root / ‘files.skn’ / ‘config.cft’)
File “/Users/Shared/CD:DVD_EXTRACT_NEW/read_sk.py”, line 38, in read_cft
for key, value in config[‘DAT’].items():
File “/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/configparser.py”, line 960, in getitem
raise KeyError(key)
KeyError: ‘DAT’
嗯,改了下终于不报keyerror了,不过又报了另一个错误 :
struct.error: unpack requires a buffer of 2 bytes
详细如下:
Traceback (most recent call last):
File “/Users/Shared/CD:DVD_EXTRACT_NEW/read_sk.py”, line 126, in
extract_files(‘/Users/Shared/Longman Word Wise Dictionary/lwd.data/fs.skn/’, ‘/Users/Shared/extracted-lwwd/’)
File “/Users/Shared/CD:DVD_EXTRACT_NEW/read_sk.py”, line 92, in extract_files
files_table = read_dat(files_config, root / ‘files.skn’ / ‘files.dat’)
File “/Users/Shared/CD:DVD_EXTRACT_NEW/read_sk.py”, line 50, in read_dat
row = unpack(bin_format, data)
File “/Users/Shared/CD:DVD_EXTRACT_NEW/rawutil.py”, line 619, in unpack
unpacked, ptr = _unpack(stct, data, None, byteorder, refdata)
File “/Users/Shared/CD:DVD_EXTRACT_NEW/rawutil.py”, line 56, in new
return ins.main(*args, **kwargs)
File “/Users/Shared/CD:DVD_EXTRACT_NEW/rawutil.py”, line 320, in main
return self.unpack(stct)
File “/Users/Shared/CD:DVD_EXTRACT_NEW/rawutil.py”, line 387, in unpack
final += struct.unpack(substruct, subdata)
struct.error: unpack requires a buffer of 2 bytes
好的,作为备用选项