坏泡菜出现错误
我一直在使用一个名为 Mnemosyne 的闪存卡程序,它使用 python 脚本。 不久前,我的计算机死机后,我的闪存卡数据库变得无法访问,我不得不手动关闭它。 每当我尝试加载包含我的卡片的数据库时,我都会收到此错误。
Invalid file format Traceback(innermost last): File "mnemosyne\core\mnemosyne_core.pyc", line 1012, in load_database BadPickleGet: 577"
帮助将不胜感激。
I have been using a flash card program called Mnemosyne which uses python script. A short time ago my database of flash cards became inaccessible after my computer froze and I had to shut it down manually. Whenever I try to load the data base containing my cards I get this error.
Invalid file format Traceback(innermost last): File "mnemosyne\core\mnemosyne_core.pyc", line 1012, in load_database BadPickleGet: 577"
Help would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
(虽然 CLayton 的副本可能是二进制发行版,但 mnemosyne 的源代码是免费提供的。)
但这并没有多大帮助:第 1012 行只是:
其中“infile”是存储的数据库文件。 所以你的数据库文件中有一些损坏的东西。 (BadPickleGet 是 UnpicklingError 的特定子类,这是您在输入损坏时所期望的。)
您可以更改 mnemosyne_core.py 以使用纯 Python pickle 模块而不是 cPickle,从而允许您将调试添加到 pickle.py 并工作准确地找出它不喜欢的文件中的内容。 但老实说,如果文件由于硬件故障/硬断电而损坏,则内容很可能被截断、无法读取或完全是垃圾。
准备好再次浏览那些早期的卡片......
(Whilst CLayton's copy may be a binary distribution, the source to mnemosyne is freely available.)
It's not much help though: line 1012 is just:
Where ‘infile’ is the stored database file. So there's something corrupt in your database file. (BadPickleGet is a specific subclass of UnpicklingError, which is what you expect when the input is broken.)
You could maybe change mnemosyne_core.py to use the plain Python pickle module instead of cPickle, allowing you to add debugging to pickle.py and work out exactly what it is in the file it doesn't like. But to be honest, if the file became corrupt due to a hardware fault/hard power down the chances are the contents are either truncated, unreadable or just total garbage.
Prepare to be going through those early cards all over again...