Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Normal
-
Resolution: Fixed
-
Affects Version/s: PUP 3.6.2
-
Fix Version/s: PUP 3.7.0
-
Component/s: None
-
Labels:None
-
Template:customfield_10700 42620
-
Story Points:0
-
Sprint:2014-09-03
Description
FileUtils.compare_stream implementation in ruby 1.9.3 was doing something along the lines of
a = b = nil |
while something |
a = as.read size
|
b = bs.read size
|
return false if a != b |
end |
FileUtils.compare_stream in 2.0 instead does this:
a = "" |
b = "" |
while something |
as.read size, a
|
bs.read size, b
|
return false if a != b |
end |
which is a problem since default encoding for strings is UTF-8 and when File#read reads into UTF-8 string it remains UTF-8 but when StringIO#read reads into UTF-8 string it becomes encoding of StringIO source string, which is ASCII for FileBucket::File contents.
This leads to problems with backing up files and under certain conditions gives errors like:
Error: Could not back up /bin/whatever.pyc: Got passed new contents for sum {md5}ca60cf7b168557fb8c34be106b8c4ae8