-
Notifications
You must be signed in to change notification settings - Fork 580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
End of line (EOL) Bear #815
Comments
Thanks for reporting this issue! A coalaian will look at it soon. |
Ah like unix vs. linux eol markers? Usually git takes care of autoconverting those if it's not misconfigured. I think when we read the file into python those get normalized but if there's an important usecase we can probably find a way to make this happen |
The scenario I have is that there is at least one file with DOS EOL, while most of the repository is Unix EOL. |
Please help me understanding what actually is wanted. I mean what does |
On Windows line endings are indicated with |
Thanks @Makman2, So now as I can understand I have got to find |
Correct. |
While working up I came to know that when python opens a file it converts '\r\n' to '\n' by default. See the second answer http://stackoverflow.com/questions/4599936/handling-r-n-vs-n-newlines-in-python-on-mac-vs-windows |
Open the file in binary mode. |
Or depending on how your are implementing this EOLBear, you might use the Python 3 only |
actually @Udayan12167 has a PR introducing a FileProxy, which could on
demand give you the binary version of the files or something so you don't
need to read the file again? @Udayan12167 ?
|
alright! so I should wait for merge on the PR or I should try by reading file again? |
Please speak with udayan about this On 3 Oct 2016 13:42, "Saurav Mehrotra" notifications@github.com wrote:
|
ping @Flap-Py |
Is the fileproxy done. I was waiting for that. And also can I get a sort of walk-through about how to use it? |
Something I found while doing rocky/python-filecache#3 , it is possible to know that the EOLs are inconsistent while using universal new lines mode. So, without loading a separate copy of the file with alternative line endings, we can know that the file has inconsistent line endings, but we do not know which lines were using a different EOL. IMO that is sufficient, because we can also auto fix the file to have a consistent EOL. |
While waiting for a perfect solution, a decent solution is to have a |
And there are some file format which should be DOS EOL even in a Unix repo, such as Batch files. c.f. review comments on loklak/loklak_server#904 |
It would be nice to have a bear that required a consistent end-of-line (EOL) marker, which is often missing at the EOF.
It should work even if
allow_trailing_whitespace
is enabled.The text was updated successfully, but these errors were encountered: