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
Joshua
zodb
Commits
033512a3
Commit
033512a3
authored
Mar 01, 2013
by
Marius Gedminas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ResourceWarnings in FileStorage.pack()
parent
b07519b5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
src/ZODB/FileStorage/FileStorage.py
src/ZODB/FileStorage/FileStorage.py
+7
-4
src/ZODB/FileStorage/fspack.py
src/ZODB/FileStorage/fspack.py
+9
-0
No files found.
src/ZODB/FileStorage/FileStorage.py
View file @
033512a3
...
@@ -1034,10 +1034,13 @@ class FileStorage(
...
@@ -1034,10 +1034,13 @@ class FileStorage(
# want to invest much in the old packer, at least for now.
# want to invest much in the old packer, at least for now.
assert
referencesf
is
not
None
assert
referencesf
is
not
None
p
=
FileStoragePacker
(
storage
,
referencesf
,
stop
,
gc
)
p
=
FileStoragePacker
(
storage
,
referencesf
,
stop
,
gc
)
try
:
opos
=
p
.
pack
()
opos
=
p
.
pack
()
if
opos
is
None
:
if
opos
is
None
:
return
None
return
None
return
opos
,
p
.
index
return
opos
,
p
.
index
finally
:
p
.
close
()
def
pack
(
self
,
t
,
referencesf
,
gc
=
None
):
def
pack
(
self
,
t
,
referencesf
,
gc
=
None
):
"""Copy data from the current database file to a packed file
"""Copy data from the current database file to a packed file
...
...
src/ZODB/FileStorage/fspack.py
View file @
033512a3
...
@@ -382,6 +382,15 @@ class FileStoragePacker(FileStorageFormatter):
...
@@ -382,6 +382,15 @@ class FileStoragePacker(FileStorageFormatter):
self
.
toid2tid
=
{}
self
.
toid2tid
=
{}
self
.
toid2tid_delete
=
{}
self
.
toid2tid_delete
=
{}
self
.
_tfile
=
None
def
close
(
self
):
self
.
_file
.
close
()
if
self
.
_tfile
is
not
None
:
self
.
_tfile
.
close
()
if
self
.
blob_removed
is
not
None
:
self
.
blob_removed
.
close
()
def
pack
(
self
):
def
pack
(
self
):
# Pack copies all data reachable at the pack time or later.
# Pack copies all data reachable at the pack time or later.
#
#
...
...
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