cuisine
cuisine copied to clipboard
file_read returns text with WINDOWS_EOL on UNIX_EOL files?
In using file_update
in concert with text_ensure_lines
, I find that my remote files are being converted from unix-style \n
to windows-style \r\n
. I see nothing obviously wrong with the code of any of the involved functions, and yet this is the behavior I'm consistently observing (using emacs to detect the EOL-style).
Of course, you can imagine the havoc this creates when encountered by BASH (and its rather fragile grasp on the reality). :)
This one frankly makes absolutely no sense to me. I hope it makes sense to you.
Looking at it, the results of file_read()
have the \r\n
in them (and with emacs I can confirm that the target file uses unix newlines), so this is before text_detect_eol
. Would this be a problem with fabric? Is it something in python's universal newline handling? What the heck?
Hmm, that's really weird. You could try to implement a test case in "tests/all.py", as the test module does not use Fabric, so it would be easy to spot where it comes from.
Also, if you could share a simple test case using Fabric, I'd be happy to test it and help debug it.