Commit 35534a41 authored by Thomas Lotze's avatar Thomas Lotze

fixed: The download API computed MD5 checksums of text files wrong on Windows.

parent 36c0cded
......@@ -9,6 +9,8 @@ Bugs fixed:
- Incrementing didn't work properly when extending multiple files.
https://bugs.launchpad.net/zc.buildout/+bug/421022
- The download API computed MD5 checksums of text files wrong on Windows.
1.4.1 (2009-08-27)
==================
......
......@@ -223,7 +223,7 @@ def check_md5sum(path, md5sum):
if md5sum is None:
return True
f = open(path)
f = open(path, 'rb')
checksum = md5()
try:
chunk = f.read(2**16)
......
......@@ -523,6 +523,21 @@ False
True
Regressions
-----------
MD5 checksum calculation needs to be reliable on all supported systems, which
requires text files to be treated as binary to avoid implicit line-ending
conversions:
>>> text = 'First line of text.\r\nSecond line.\r\n'
>>> f = open(join(server_data, 'foo.txt'), 'wb')
>>> f.write(text)
>>> f.close()
>>> path, is_temp = Download()(server_url+'foo.txt', md5(text).hexdigest())
>>> remove(path)
Clean up
--------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment