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
d6bcc5a4
Commit
d6bcc5a4
authored
Nov 21, 2018
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
repozo: do not close file in concat function
But let the caller opening the file closing it
parent
a8358277
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
3 deletions
+1
-3
src/ZODB/scripts/repozo.py
src/ZODB/scripts/repozo.py
+0
-2
src/ZODB/scripts/tests/test_repozo.py
src/ZODB/scripts/tests/test_repozo.py
+1
-1
No files found.
src/ZODB/scripts/repozo.py
View file @
d6bcc5a4
...
@@ -360,8 +360,6 @@ def concat(files, ofp=None):
...
@@ -360,8 +360,6 @@ def concat(files, ofp=None):
ifp
=
open
(
f
,
'rb'
)
ifp
=
open
(
f
,
'rb'
)
bytesread
+=
dofile
(
func
,
ifp
)
bytesread
+=
dofile
(
func
,
ifp
)
ifp
.
close
()
ifp
.
close
()
if
ofp
:
ofp
.
close
()
return
bytesread
,
sum
.
hexdigest
()
return
bytesread
,
sum
.
hexdigest
()
...
...
src/ZODB/scripts/tests/test_repozo.py
View file @
d6bcc5a4
...
@@ -414,7 +414,7 @@ class Test_concat(OptionsTestBase, unittest.TestCase):
...
@@ -414,7 +414,7 @@ class Test_concat(OptionsTestBase, unittest.TestCase):
ofp
=
Faux
()
ofp
=
Faux
()
bytes
,
sum
=
self
.
_callFUT
(
files
,
ofp
)
bytes
,
sum
=
self
.
_callFUT
(
files
,
ofp
)
self
.
assertEqual
(
ofp
.
_written
,
[
x
.
encode
()
for
x
in
'ABC'
])
self
.
assertEqual
(
ofp
.
_written
,
[
x
.
encode
()
for
x
in
'ABC'
])
self
.
assert
Tru
e
(
ofp
.
_closed
)
self
.
assert
Fals
e
(
ofp
.
_closed
)
_marker
=
object
()
_marker
=
object
()
class
Test_gen_filename
(
OptionsTestBase
,
unittest
.
TestCase
):
class
Test_gen_filename
(
OptionsTestBase
,
unittest
.
TestCase
):
...
...
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