I would like to convert the line endings for krds.py on github from \r\n to \n
Are there any objections?
Rationale is as follows:
When I invoke krds.py directly under linux instead of invoking python with krds.py as an argument, it dies with:
Code:
krds.py: /usr/bin/python3^M: bad interpreter: No such file or directory
which is a complaint that the file with a carriage return as the end if its name does not exist.
I searched around and mostly found blogs automatically generated documentation sites that discussed reading and writing cross platform text files and only mentioned python script line endings in passing.
They all agreed that python itself tries to be agnostic about line endings, but that best practice is to use the UNIX style LF for line endings.
I don't know what windows does when (trying) to execute a python script directly, but I'm guessing that it ignores the #! line then crashes. I hope that macs work with the \n ending and maybe they treat the \r as white space, but maybe the script crashes for the same reason as linux.
In any case, the only use for the shebang (#!) line is to allow direct script execution. So the line as is should either be removed, its ending changed to \n only, or the entire script changed to LF only line endings. For the above reasons I would like to do the last. (Besides, it save 398 bytes.)
I am not a python person and don't use microsoft or apple products, so I might be overlooking something. If so, let me know.
ETA:
I tried limiting my search to python.org and found
https://discuss.python.org/t/page-au...g-solved/26644
so I'm also inclined to change the shebang line to
Code:
#! /usr/bin/env python3