Mantis - Squeak
Viewing Issue Advanced Details
6933 Collections minor always 02-18-08 01:18 04-18-10 22:04
ykoubo  
andreas  
normal  
closed 3.9  
fixed  
none    
none trunk  
0006933: MultiByteFileStream>>upTo: fails for binary
In the binary mode, MultiByteFileStream>>upTo: raises error to read non-character contents.
That method uses a String as a temporary buffur, and String could not accept non-character data.
 MultiByteFileStream-binaryUpTo.1.cs [^] (532 bytes) 02-18-08 01:20
 MultiByteFileStream-binaryUpTo-M6933-Test-nice.1.cs [^] (1,052 bytes) 02-19-08 22:01
 MultiByteFileStream-binaryUpTo-M6933-Patch-ky-nice.2.cs [^] (781 bytes) 10-17-08 19:20
 MultiByteFileStream-binaryUpTo-M6933-Test-nice.2.cs [^] (981 bytes) 10-17-08 19:20

Notes
(0011820)
ykoubo   
02-18-08 01:22   
I attached a fix to use a ByteArray buffer for binary.
(0011821)
wiz   
02-18-08 03:18   
Hi ykoubo,

Thanks for your report and fix.

Can you provide an sunit test that fails before the patch and works after.

testBinaryUpTo:
<something>
self shouldnt: [ <something that failed ] raise: Error

etc

would be the likely pattern.

Also any other good tortures for the streams you can think of would probably helpful.

The test will help harvesters know your fix works.

Also your test will prevent the fix from getting undone.

Yours in service and curiosity, --Jerome Peace
(0011871)
nicolas cellier   
02-25-08 21:02   
"fix begin"
Installer mantis bug: 6933 fix:'MultiByteFileStream-binaryUpTo.1.cs'.
"fix test"
Installer mantis bug: 6933 fix:'MultiByteFileStream-binaryUpTo-M6933-Test-nice.1.cs'.
"fix end"

(0012745)
nicolas cellier   
10-17-08 19:19   
I reviewed more carefully for Pharo, and saw that:
1) my test was wrong (1 2 3 4) upTo: 3 -> (1 2) (upTo: is excluding delimiter)
2) ky patch has a remaining ^''

So please find updates proposed in Pharo

(0012746)
nicolas cellier   
10-17-08 19:22   
"fix begin"
Installer mantis bug: 6933 fix:'MultiByteFileStream-binaryUpTo-M6933-Patch-ky-nice.2.cs'.
"fix test"
Installer mantis bug: 6933 fix:'MultiByteFileStream-binaryUpTo-M6933-Test-nice.2.cs'.
"fix end"
(0013333)
nicolas cellier   
10-04-09 18:52   
Fixed in http://source.squeak.org/trunk/Multilingual-cbc.47.mcz [^]
then in http://source.squeak.org/trunk/Multilingual-nice.49.mcz [^]