Commit 96a9413f authored by Tres Seaver's avatar Tres Seaver

Use a new magic number for protocol-3 filestorage.

parent 4eceeacb
......@@ -78,12 +78,13 @@ from ZODB._compat import loads
from ZODB._compat import decodebytes
from ZODB._compat import encodebytes
from ZODB._compat import _protocol
from ZODB._compat import FILESTORAGE_MAGIC
# Not all platforms have fsync
fsync = getattr(os, "fsync", None)
packed_version = b"FS21"
packed_version = FILESTORAGE_MAGIC
logger = logging.getLogger('ZODB.FileStorage')
......
......@@ -23,6 +23,7 @@ try:
IMPORT_MAPPING = {}
NAME_MAPPING = {}
_protocol = 1
FILESTORAGE_MAGIC = b"FS21"
except ImportError:
# Python 3.x: can't use stdlib's pickle because
# http://bugs.python.org/issue6784
......@@ -57,6 +58,7 @@ except ImportError:
def loads(s):
return zodbpickle.pickle.loads(s, encoding='ASCII', errors='bytes')
_protocol = 3
FILESTORAGE_MAGIC = b"FS30"
# XXX: consistent spelling of inst_persistent_id/persistent_id?
......
......@@ -39,6 +39,7 @@ from __future__ import print_function
import binascii
import struct
import sys
from ZODB._compat import FILESTORAGE_MAGIC
class FormatError(ValueError):
"""There is a problem with the format of the FileStorage."""
......@@ -47,7 +48,7 @@ class Status:
checkpoint = b'c'
undone = b'u'
packed_version = b'FS21'
packed_version = FILESTORAGE_MAGIC
TREC_HDR_LEN = 23
DREC_HDR_LEN = 42
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment