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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZEO
Commits
c1e4995c
Commit
c1e4995c
authored
Jul 15, 2010
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fixed:
parent
8d589632
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
8 deletions
+20
-8
src/CHANGES.txt
src/CHANGES.txt
+13
-0
src/ZODB/DemoStorage.py
src/ZODB/DemoStorage.py
+6
-6
src/ZODB/DemoStorage.test
src/ZODB/DemoStorage.test
+1
-2
No files found.
src/CHANGES.txt
View file @
c1e4995c
...
...
@@ -2,6 +2,19 @@
Change History
================
3.10.0b3 (2010-07-15)
=====================
Bugs fixed
----------
- A change in 3.10.0b2:
"DemoStorages didn't close their changes databases when they were
created temporarily (not passed to the constructor)."
Introduced a backward-compatibility problem for some applications.
3.10.0b2 (2010-07-13)
=====================
...
...
src/ZODB/DemoStorage.py
View file @
c1e4995c
...
...
@@ -39,7 +39,7 @@ class DemoStorage(object):
)
def
__init__
(
self
,
name
=
None
,
base
=
None
,
changes
=
None
,
close_base_on_close
=
None
,
close_changes_on_close
=
Tru
e
):
close_base_on_close
=
None
,
close_changes_on_close
=
Non
e
):
if
close_base_on_close
is
None
:
if
base
is
None
:
...
...
@@ -56,9 +56,13 @@ class DemoStorage(object):
self
.
_temporary_changes
=
True
changes
=
ZODB
.
MappingStorage
.
MappingStorage
()
zope
.
interface
.
alsoProvides
(
self
,
ZODB
.
interfaces
.
IBlobStorage
)
if
close_changes_on_close
is
None
:
close_changes_on_close
=
False
else
:
if
ZODB
.
interfaces
.
IBlobStorage
.
providedBy
(
changes
):
zope
.
interface
.
alsoProvides
(
self
,
ZODB
.
interfaces
.
IBlobStorage
)
if
close_changes_on_close
is
None
:
close_changes_on_close
=
True
self
.
changes
=
changes
self
.
close_changes_on_close
=
close_changes_on_close
...
...
@@ -77,12 +81,11 @@ class DemoStorage(object):
self
.
_next_oid
=
random
.
randint
(
1
,
1
<<
62
)
__temporary_blobdir
=
None
def
_blobify
(
self
):
if
(
self
.
_temporary_changes
and
isinstance
(
self
.
changes
,
ZODB
.
MappingStorage
.
MappingStorage
)
):
blob_dir
=
self
.
__temporary_blobdir
=
tempfile
.
mkdtemp
(
'.demoblobs'
)
blob_dir
=
tempfile
.
mkdtemp
(
'.demoblobs'
)
_temporary_blobdirs
[
weakref
.
ref
(
self
,
cleanup_temporary_blobdir
)
]
=
blob_dir
...
...
@@ -104,9 +107,6 @@ class DemoStorage(object):
self
.
base
.
close
()
if
self
.
close_changes_on_close
:
self
.
changes
.
close
()
if
(
self
.
__temporary_blobdir
and
os
.
path
.
exists
(
self
.
__temporary_blobdir
)):
ZODB
.
blob
.
remove_committed_dir
(
self
.
__temporary_blobdir
)
def
_copy_methods_from_changes
(
self
,
changes
):
for
meth
in
(
...
...
src/ZODB/DemoStorage.test
View file @
c1e4995c
...
...
@@ -278,9 +278,8 @@ storage wrapped around it when necessary:
For now, it won't go until the storage does.
>>> transaction.abort()
>>> conn.close()
>>> blobdir = storage.temporaryDirectory()
>>> del
db, conn,
storage, _
>>> del storage, _
>>> import gc
>>> _ = gc.collect()
...
...
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