4.5 years ago by
So, the short answer here is that the 'is_binary' check is failing to detect this particular file. The first 100 characters all happen to be printable (see lib/galaxy/util/__init__.py: is_binary() and lib/galaxy/datatypes/checkers.py: check_binary if you're really interested). Since the upload method fails to detect it as binary (or as a datatype with to_posix_lines set to False), the line endings are automatically converted.
I'm not sure why this is even being attempted with the extension being manually set, but there may be a good reason I'm not aware of, so I'll look into it -- I don't see this having changed recently. A really hacky fix for right now that results in the file being correctly detected is bumping up the temp.read(100) in check_binary to include more sample bytes from the file.
Edit* This should be resolved in the following commit that'll be in the next release: