Message7353
Hi all:
Norbert, glad you got the import working (in later message).
But a note here on the weird \r\r\n line ending.
https://stackoverflow.com/questions/9845681/does-python-csv-writer-always-use-dos-end-of-line-characters#comment76482943_29976091
mentions:
open('file.csv', 'wb')...
For others who find this post, don't miss the 'wb' if you're still
using Python 2. (In Python 3, this problem is handled by
Python). You won't notice a problem if you're missing it on some
platforms like GNU/Linux, but it is important to open the file in
binary mode on platforms where that matters, like
Windows. Otherwise, the csv file can end up with line endings like
\r\r\n. If you use the 'wb' and os.linesep, your line endings
should be correct on all platforms.
So this looks like a combination of:
Use of python 2 on windows (and missing the 'wb' option)
and
import on linux
Norbert, what version of python is used on the turnkey appliance?
I wonder if setting line ending to \n for csv.reader and csv.writer
will work for all combinations of:
windows, linux
export python 2, 3
import python 2, 3
At the very least \r\r\n shouldn't get created as that requires using
dos2unix twice on the file to convert it fully.
Also Universal newline support (mentioned by Ralf as a possible solution)
caused issues in:
https://issues.roundup-tracker.org/issue1163890
and was removed in changeset: 3283:4fe232899be8 in the 0.8 timeframe.
It may be fixed by now? Still universal line endings won't handle \r\r\n.
(Note I am including the tracker in this email so we get it on ticket.) |
|
Date |
User |
Action |
Args |
2021-11-04 13:59:15 | rouilj | set | recipients:
+ rouilj, noschvie |
2021-11-04 13:59:15 | rouilj | link | issue2551166 messages |
2021-11-04 13:59:15 | rouilj | create | |
|