Closed thorade closed 9 years ago
Also part of v0.6.1 now.
On my machine ttws v0.6.1 adds a CR
to every trimmed line instead of CRLF
.
Can I print the value of os.linesep
in IDLE?
On your machine could you do:
$ python3
Python 3.4.2 (default, Oct 8 2014, 13:08:17)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> print(repr(os.linesep))
'\n'
That command returns \r\n
(as also reported by ttws --help
)
Are you sure you get CR
instead of CRLF
then?
OK I'll need to look into this. Funny that the line endings are different.
Just to let you know that I could reproduce this. Strange that it ONLY happens for CRLF, CR and LF work fine. Windows causing trouble again.
Thanks for confirming. I'll just use ttws --eol=CRLF
for now, so no need to hurry.
Well that's the thing the CRLF option does not properly work.
Oh, now I see. It worked before the changes, I just had to enforce --eol=CRLF
, only the default was not set.
OK this is a hint. I think I know what's going on ... but not sure how to solve it yet.
OK finally fixed this. When using os.linesep
(normally discouraged in combination with writing files but we like to explicitly override the default os.linesep) one needs to set newline=''
in io.open.
Fixed in 2e3d580eb271
Awesome, works for me
I just started to use ttws 0.6.0 on Windows 7 64 bit German with Python 3.4 ;-)
As discussed in #9 there is an option to enforce the line ending stlye. All my files have
CRLF
. If I runttws --eol=CRLF TestDicrecoty
everything is fine, but if I usettws TestDirectory
without specifying the eol option explicitly, ttws will convert everything toLF
, even though the help text correctly states that my system uses\r\n
akaCRLF
. For now, I can perfectly live with explicitly specifying the EOL format, so this issue has vey low priority.