Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZODB
Commits
96a9413f
Commit
96a9413f
authored
Jun 08, 2013
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use a new magic number for protocol-3 filestorage.
parent
4eceeacb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
2 deletions
+6
-2
src/ZODB/FileStorage/FileStorage.py
src/ZODB/FileStorage/FileStorage.py
+2
-1
src/ZODB/_compat.py
src/ZODB/_compat.py
+2
-0
src/ZODB/scripts/fstest.py
src/ZODB/scripts/fstest.py
+2
-1
No files found.
src/ZODB/FileStorage/FileStorage.py
View file @
96a9413f
...
@@ -78,12 +78,13 @@ from ZODB._compat import loads
...
@@ -78,12 +78,13 @@ from ZODB._compat import loads
from
ZODB._compat
import
decodebytes
from
ZODB._compat
import
decodebytes
from
ZODB._compat
import
encodebytes
from
ZODB._compat
import
encodebytes
from
ZODB._compat
import
_protocol
from
ZODB._compat
import
_protocol
from
ZODB._compat
import
FILESTORAGE_MAGIC
# Not all platforms have fsync
# Not all platforms have fsync
fsync
=
getattr
(
os
,
"fsync"
,
None
)
fsync
=
getattr
(
os
,
"fsync"
,
None
)
packed_version
=
b"FS21"
packed_version
=
FILESTORAGE_MAGIC
logger
=
logging
.
getLogger
(
'ZODB.FileStorage'
)
logger
=
logging
.
getLogger
(
'ZODB.FileStorage'
)
...
...
src/ZODB/_compat.py
View file @
96a9413f
...
@@ -23,6 +23,7 @@ try:
...
@@ -23,6 +23,7 @@ try:
IMPORT_MAPPING
=
{}
IMPORT_MAPPING
=
{}
NAME_MAPPING
=
{}
NAME_MAPPING
=
{}
_protocol
=
1
_protocol
=
1
FILESTORAGE_MAGIC
=
b"FS21"
except
ImportError
:
except
ImportError
:
# Python 3.x: can't use stdlib's pickle because
# Python 3.x: can't use stdlib's pickle because
# http://bugs.python.org/issue6784
# http://bugs.python.org/issue6784
...
@@ -57,6 +58,7 @@ except ImportError:
...
@@ -57,6 +58,7 @@ except ImportError:
def
loads
(
s
):
def
loads
(
s
):
return
zodbpickle
.
pickle
.
loads
(
s
,
encoding
=
'ASCII'
,
errors
=
'bytes'
)
return
zodbpickle
.
pickle
.
loads
(
s
,
encoding
=
'ASCII'
,
errors
=
'bytes'
)
_protocol
=
3
_protocol
=
3
FILESTORAGE_MAGIC
=
b"FS30"
# XXX: consistent spelling of inst_persistent_id/persistent_id?
# XXX: consistent spelling of inst_persistent_id/persistent_id?
...
...
src/ZODB/scripts/fstest.py
View file @
96a9413f
...
@@ -39,6 +39,7 @@ from __future__ import print_function
...
@@ -39,6 +39,7 @@ from __future__ import print_function
import
binascii
import
binascii
import
struct
import
struct
import
sys
import
sys
from
ZODB._compat
import
FILESTORAGE_MAGIC
class
FormatError
(
ValueError
):
class
FormatError
(
ValueError
):
"""There is a problem with the format of the FileStorage."""
"""There is a problem with the format of the FileStorage."""
...
@@ -47,7 +48,7 @@ class Status:
...
@@ -47,7 +48,7 @@ class Status:
checkpoint
=
b'c'
checkpoint
=
b'c'
undone
=
b'u'
undone
=
b'u'
packed_version
=
b'FS21'
packed_version
=
FILESTORAGE_MAGIC
TREC_HDR_LEN
=
23
TREC_HDR_LEN
=
23
DREC_HDR_LEN
=
42
DREC_HDR_LEN
=
42
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment