How to check what lineending a StringIO file is using?
How to check what lineending a StringIO file is using? Question: I had a method that detects line endings def getLineEnding(filename): ret = "rn" with open(filename, ‘r’) as f: f.readline() ret = f.newlines return ret In order to be able to test it without using real files, I changed it to: def getLineEnding(filehandle): filehandle.readline() return …