# HG changeset patch # User Paul Boddie # Date 1633471230 -7200 # Node ID 4ee5060ca9b4a170185db7d1910f668f3f40d6ce # Parent a3a768cc604cb457d4ff9a703b8f1aca32d5eb46 Convert DOS line endings to UNIX ones, thus handling uploaded content. diff -r a3a768cc604c -r 4ee5060ca9b4 moinformat/utils/file.py --- a/moinformat/utils/file.py Mon Oct 04 22:19:39 2021 +0200 +++ b/moinformat/utils/file.py Wed Oct 06 00:00:30 2021 +0200 @@ -3,7 +3,7 @@ """ File utilities. -Copyright (C) 2019 Paul Boddie +Copyright (C) 2019, 2021 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -30,7 +30,7 @@ f = codecs.open(filename, encoding=encoding) try: - return f.read() + return f.read().replace("\r\n", "\n") finally: f.close()