Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
72174f79
Commit
72174f79
authored
Apr 12, 2001
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added checks for empty strings in commit/abortVersion and
versionEmpty.
parent
259903e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
src/ZODB/FileStorage.py
src/ZODB/FileStorage.py
+15
-1
No files found.
src/ZODB/FileStorage.py
View file @
72174f79
...
...
@@ -184,7 +184,7 @@
# may have a back pointer to a version record or to a non-version
# record.
#
__version__
=
'$Revision: 1.5
3
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.5
4
$'
[
11
:
-
2
]
import
struct
,
time
,
os
,
bpthread
,
string
,
base64
,
sys
from
struct
import
pack
,
unpack
...
...
@@ -203,6 +203,8 @@ import ConflictResolution
try
:
from
posix
import
fsync
except
:
fsync
=
None
StringType
=
type
(
''
)
z64
=
'
\
0
'
*
8
def
warn
(
message
,
*
data
):
...
...
@@ -450,6 +452,11 @@ class FileStorage(BaseStorage.BaseStorage,
def
commitVersion
(
self
,
src
,
dest
,
transaction
,
abort
=
None
):
# We are going to commit by simply storing back pointers.
if
(
not
src
or
type
(
src
)
is
not
StringType
or
type
(
dest
)
is
not
StringType
):
raise
POSException
.
VersionCommitError
(
'Invalid source version'
)
if
dest
and
abort
:
raise
'VersionCommitError'
,
(
'Internal error, can
\
'
t abort to a version'
)
...
...
@@ -1074,6 +1081,13 @@ class FileStorage(BaseStorage.BaseStorage,
finally
:
self
.
_lock_release
()
def
versionEmpty
(
self
,
version
):
if
not
version
:
# The interface is silent on this case. I think that this should
# be an error, but Barry thinks this should return 1 if we have
# any non-version data. This would be excruciatingly painful to
# test, so I must be right. ;)
raise
POSException
.
VersionError
(
'The version must be an non-empty string'
)
self
.
_lock_acquire
()
try
:
index
=
self
.
_index
...
...
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