[英]Got “malformed database schema” while open .svn/wc.db Using Python2.6.6
I'm attempt to get the revision of my work copy (subversion) using Python. 我试图使用Python获取我的工作副本(Subversion)的修订版。 My Python is 2.6.6, and this is my code:
我的Python是2.6.6,这是我的代码:
import sqlite3
conn = sqlite3.connect("wc.db")
cursor = conn.cursor()
record = cursor.execute("SELECT revision FROM NODES LIMIT 1")
print record
After run, i got: 运行后,我得到:
traceback (most recent call last):
File "get_revision.py", line 5, in <module>
record = cursor.execute("SELECT revision FROM NODES LIMIT 1")
sqlite3.DatabaseError: malformed database schema (nodes_update_checksum_trigger) - near "OLD": syntax error
Is that means the version of sqlite3 of Python 2.6.6 too old? 这是否意味着Python 2.6.6的sqlite3版本太旧了? I looked:
我看了:
Python 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> sqlite3.version
'2.4.1'
>>>
Yes, I think you are correct: I think it means that the version of SQLite3 which wrote the database file was newer than the version with which you're trying to read it. 是的,我认为您是正确的:我认为这意味着编写数据库文件的SQLite3版本比您尝试读取该文件的版本新。
I encountered the same problem when reading Chrome/Chromium "Local Storage" from Python. 从Python读取Chrome / Chromium“本地存储”时遇到了相同的问题。 My copy of Python (version 3.5.2) could read the localstorage file if it was written by Chrome or Chromium version 55 or earlier, but not if it was written by Chromium version 57, and the error I got was the same as the one you got: "malformed database schema"
如果我的Python副本(版本3.5.2)是由Chrome或Chromium 55版或更早版本编写的,则可以读取localstorage文件,但是如果它是由Chromium 57版编写的,则不能读取,并且我得到的错误与该错误相同您得到:“格式错误的数据库架构”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.