Closed jvroutak closed 5 years ago
Looks like the line ending is \r\n
on the left and \n
on the right in the assertion. Maybe GIT automatically converts line endings on checkout, but I cannot explain why it only happend to one of the two files.
Try to download the ZIP file of the repository instead. Maybe it solves the issue.
Right, that indeed seems to be the issue.
bincopy is cloned with core.autocrlf=false; bincopy2 is cloned with core.autocrlf=true.
juho@DESKTOP MINGW64 ~/Documents/git
$ python -m hexdump bincopy/tests/files/binary2.bin
00000000: 3A 32 30 30 31 30 30 30 30 32 31 34 36 30 31 33 :200100002146013
00000010: 36 30 31 32 31 34 37 30 31 33 36 30 30 37 45 46 60121470136007EF
00000020: 45 30 39 44 32 31 39 30 31 32 31 34 36 30 31 37 E09D219012146017
00000030: 45 31 37 43 32 30 30 30 31 46 46 35 46 31 36 30 E17C20001FF5F160
00000040: 30 32 31 34 38 30 31 31 39 37 39 0A 3A 32 30 30 02148011979.:200
00000050: 31 32 30 30 30 31 39 34 45 37 39 32 33 34 36 32 12000194E7923462
00000060: 33 39 36 35 37 37 38 32 33 39 45 44 41 33 46 30 3965778239EDA3F0
00000070: 31 42 32 43 41 33 46 30 31 35 36 37 30 32 42 35 1B2CA3F0156702B5
00000080: 45 37 31 32 42 37 32 32 42 37 33 32 31 34 36 30 E712B722B7321460
00000090: 31 33 34 32 31 39 46 0A 3A 30 30 30 30 30 30 30 134219F.:0000000
000000A0: 31 46 46 0A 1FF.
juho@DESKTOP MINGW64 ~/Documents/git
$ python -m hexdump bincopy/tests/files/binary3.bin
00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3A ...............:
00000010: 32 30 30 31 3A 32 30 30 31 30 30 30 30 32 31 34 2001:20010000214
00000020: 36 30 31 33 36 30 31 32 31 34 37 30 31 33 36 30 6013601214701360
00000030: 30 37 45 46 45 30 39 44 32 31 39 30 31 32 31 34 07EFE09D21901214
00000040: 36 30 31 37 45 31 37 43 32 30 30 30 31 46 46 35 6017E17C20001FF5
00000050: 46 31 36 30 30 32 31 34 38 30 31 31 39 37 39 0A F16002148011979.
00000060: 3A 32 30 30 31 32 30 30 30 31 39 34 45 37 39 32 :20012000194E792
00000070: 33 34 36 32 33 39 36 35 37 37 38 32 33 39 45 44 34623965778239ED
00000080: 41 33 46 30 31 42 32 43 41 33 46 30 31 35 36 37 A3F01B2CA3F01567
00000090: 30 32 42 35 45 37 31 32 42 37 32 32 42 37 33 32 02B5E712B722B732
000000A0: 31 34 36 30 31 33 34 32 31 39 46 0A 3A 30 30 30 1460134219F.:000
000000B0: 30 30 30 30 31 46 46 0A 00001FF.
juho@DESKTOP MINGW64 ~/Documents/git
$ python -m hexdump bincopy2/tests/files/binary2.bin
00000000: 3A 32 30 30 31 30 30 30 30 32 31 34 36 30 31 33 :200100002146013
00000010: 36 30 31 32 31 34 37 30 31 33 36 30 30 37 45 46 60121470136007EF
00000020: 45 30 39 44 32 31 39 30 31 32 31 34 36 30 31 37 E09D219012146017
00000030: 45 31 37 43 32 30 30 30 31 46 46 35 46 31 36 30 E17C20001FF5F160
00000040: 30 32 31 34 38 30 31 31 39 37 39 0D 0A 3A 32 30 02148011979..:20
00000050: 30 31 32 30 30 30 31 39 34 45 37 39 32 33 34 36 012000194E792346
00000060: 32 33 39 36 35 37 37 38 32 33 39 45 44 41 33 46 23965778239EDA3F
00000070: 30 31 42 32 43 41 33 46 30 31 35 36 37 30 32 42 01B2CA3F0156702B
00000080: 35 45 37 31 32 42 37 32 32 42 37 33 32 31 34 36 5E712B722B732146
00000090: 30 31 33 34 32 31 39 46 0D 0A 3A 30 30 30 30 30 0134219F..:00000
000000A0: 30 30 31 46 46 0D 0A 001FF..
juho@DESKTOP MINGW64 ~/Documents/git
$ python -m hexdump bincopy2/tests/files/binary3.bin
00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3A ...............:
00000010: 32 30 30 31 3A 32 30 30 31 30 30 30 30 32 31 34 2001:20010000214
00000020: 36 30 31 33 36 30 31 32 31 34 37 30 31 33 36 30 6013601214701360
00000030: 30 37 45 46 45 30 39 44 32 31 39 30 31 32 31 34 07EFE09D21901214
00000040: 36 30 31 37 45 31 37 43 32 30 30 30 31 46 46 35 6017E17C20001FF5
00000050: 46 31 36 30 30 32 31 34 38 30 31 31 39 37 39 0A F16002148011979.
00000060: 3A 32 30 30 31 32 30 30 30 31 39 34 45 37 39 32 :20012000194E792
00000070: 33 34 36 32 33 39 36 35 37 37 38 32 33 39 45 44 34623965778239ED
00000080: 41 33 46 30 31 42 32 43 41 33 46 30 31 35 36 37 A3F01B2CA3F01567
00000090: 30 32 42 35 45 37 31 32 42 37 32 32 42 37 33 32 02B5E712B722B732
000000A0: 31 34 36 30 31 33 34 32 31 39 46 0A 3A 30 30 30 1460134219F.:000
000000B0: 30 30 30 30 31 46 46 0A 00001FF.
Tests succeed for bincopy but fail with the same error for bincopy2.
Looks like .gitattributes could solve this?
Yes, can you add one as you can reproduce the issue?
I have never used a .gitattributes file, but I guess *.bin -text
could work.
https://stackoverflow.com/questions/11162267/how-do-i-make-git-treat-a-file-as-binary
@jvroutak Any progress, or should I close the issue without a fix?
I haven't had the time to confirm the fix yet, sorry about that. I should be able to finish this next week though.
Ok
Fixed in #13
One test fails on 64-bit Windows 10 host & 32-bit Python:
Tests seem to fail: