<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 11, 2016 at 11:15 AM, Huidae Cho <span dir="ltr"><<a href="mailto:grass4u@gmail.com" target="_blank">grass4u@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><p dir="ltr">What about this then? For reading text files, use \r\n.  For reading outputs from GRASS modules and writing, use os.linesep.</p>
<p dir="ltr">I think this makes sense because it can handle cross platform files safely and it's very unlikely to have mixed newlines from modules compiled on the same platform. </p>
<p dir="ltr">Or simply just use \r\n for reading and os.linesep for writing? </p><span class=""><font color="#888888">
<p dir="ltr"></p></font></span></blockquote></div><br><br></div><div class="gmail_extra">It seems to me that one of these is need and simple os.linesep is not enough. I'm never sure how Python solves this for splitlines() and others. I was quite struggling with it in the gunittest where sample data and code usually have \n but on Windows you get \r\n in the created data. Now I'm usually replacing \r\n everywhere and doing comparisons afterwards but that's not really applicable for the normal code.<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Vaclav<br></div><div class="gmail_extra"><br><a href="https://trac.osgeo.org/grass/changeset/64662">https://trac.osgeo.org/grass/changeset/64662</a><br><a href="https://trac.osgeo.org/grass/changeset/64734">https://trac.osgeo.org/grass/changeset/64734</a><br><a href="https://trac.osgeo.org/grass/changeset/64683">https://trac.osgeo.org/grass/changeset/64683</a><br></div></div>