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
cc6e9c37
Commit
cc6e9c37
authored
Nov 19, 2009
by
Chris Withers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The md5 package is deprecated in Python 2.6
parent
da2341b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
src/ZODB/scripts/repozo.py
src/ZODB/scripts/repozo.py
+9
-4
No files found.
src/ZODB/scripts/repozo.py
View file @
cc6e9c37
...
@@ -65,7 +65,6 @@ Options for -R/--recover:
...
@@ -65,7 +65,6 @@ Options for -R/--recover:
import
os
import
os
import
sys
import
sys
import
md5
import
gzip
import
gzip
import
time
import
time
import
errno
import
errno
...
@@ -82,6 +81,12 @@ COMMASPACE = ', '
...
@@ -82,6 +81,12 @@ COMMASPACE = ', '
READCHUNK
=
16
*
1024
READCHUNK
=
16
*
1024
VERBOSE
=
False
VERBOSE
=
False
if
sys
.
version_info
[
1
]
>
4
:
# the hashlib package is available from Python 2.5
from
hashlib
import
md5
else
:
# the md5 package is deprecated in Python 2.6
from
md5
import
new
as
md5
def
usage
(
code
,
msg
=
''
):
def
usage
(
code
,
msg
=
''
):
outfp
=
sys
.
stderr
outfp
=
sys
.
stderr
...
@@ -210,7 +215,7 @@ def dofile(func, fp, n=None):
...
@@ -210,7 +215,7 @@ def dofile(func, fp, n=None):
def
checksum
(
fp
,
n
):
def
checksum
(
fp
,
n
):
# Checksum the first n bytes of the specified file
# Checksum the first n bytes of the specified file
sum
=
md5
.
new
()
sum
=
md5
()
def
func
(
data
):
def
func
(
data
):
sum
.
update
(
data
)
sum
.
update
(
data
)
dofile
(
func
,
fp
,
n
)
dofile
(
func
,
fp
,
n
)
...
@@ -221,7 +226,7 @@ def copyfile(options, dst, start, n):
...
@@ -221,7 +226,7 @@ def copyfile(options, dst, start, n):
# Copy bytes from file src, to file dst, starting at offset start, for n
# Copy bytes from file src, to file dst, starting at offset start, for n
# length of bytes. For robustness, we first write, flush and fsync
# length of bytes. For robustness, we first write, flush and fsync
# to a temp file, then rename the temp file at the end.
# to a temp file, then rename the temp file at the end.
sum
=
md5
.
new
()
sum
=
md5
()
ifp
=
open
(
options
.
file
,
'rb'
)
ifp
=
open
(
options
.
file
,
'rb'
)
ifp
.
seek
(
start
)
ifp
.
seek
(
start
)
tempname
=
os
.
path
.
join
(
os
.
path
.
dirname
(
dst
),
'tmp.tmp'
)
tempname
=
os
.
path
.
join
(
os
.
path
.
dirname
(
dst
),
'tmp.tmp'
)
...
@@ -248,7 +253,7 @@ def concat(files, ofp=None):
...
@@ -248,7 +253,7 @@ def concat(files, ofp=None):
# Concatenate a bunch of files from the repository, output to `outfile' if
# Concatenate a bunch of files from the repository, output to `outfile' if
# given. Return the number of bytes written and the md5 checksum of the
# given. Return the number of bytes written and the md5 checksum of the
# bytes.
# bytes.
sum
=
md5
.
new
()
sum
=
md5
()
def
func
(
data
):
def
func
(
data
):
sum
.
update
(
data
)
sum
.
update
(
data
)
if
ofp
:
if
ofp
:
...
...
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