简体   繁体   English

使用Python2.6.6打开.svn / wc.db时出现“格式错误的数据库架构”

[英]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.

相关问题 python2.6.6安装问题 - python2.6.6 installation problem 无法解决Subversion 1.8.8“进行检查”问题-失败:wc_tests.py 7:无法访问.svn / wc.db - Having trouble resolving a subversion 1.8.8 “make check test” - FAIL: wc_tests.py 7: inaccessible .svn/wc.db ValueError:Python2.6.6格式的零长度字段名称 - ValueError: zero length field name in format in Python2.6.6 从版本python2.6.6的位置导入pandas - Importing pandas from a location for version python2.6.6 python pyodbc-在Windows / python2.7上连接到SQL Server 2008,但不在centOS6.32 / python2.6.6上连接 - python pyodbc - connecting to sql server 2008 on windows/python2.7 but not on centOS6.32/python2.6.6 python2.6.6将apache日志时间戳转换为epoch以来的秒数(unix样式) - python2.6.6 Convert apache log timestamp to seconds since epoch (unix style) 在OSX Snow Leopard上安装IPython以使用非默认的python版本(即python2.6.6 / python2.7) - Installing IPython to work with a non-default python version (i.e python2.6.6/python2.7) on OSX Snow Leopard 使用python 2.6.6传输推文时出现连接错误 - Getting connection error while streaming tweets using python 2.6.6 在 Python 2.6.6 中使用 pyopengl 出现问题 - Trouble using pyopengl in Python 2.6.6 使用 python 打开数据库文件 (.db) - Open database files (.db) using python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM