From 976e8981fd9d6a98dd1ffa0184451f8da9ec1526 Mon Sep 17 00:00:00 2001 From: Nicklas Larsson Date: Wed, 30 Nov 2022 17:06:42 +0100 Subject: [PATCH] gunittest: remove deprecated 'U'-mode for open() (#2673) 'U'-mode was deprecated since Python 3.4, it is removed in Python 3.11. --- python/grass/gunittest/case.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/python/grass/gunittest/case.py b/python/grass/gunittest/case.py index f66b5147571..0f9c81f2e06 100644 --- a/python/grass/gunittest/case.py +++ b/python/grass/gunittest/case.py @@ -1239,9 +1239,8 @@ def assertVectorAsciiEqualsVectorAscii( """ import difflib - # 'U' taken from difflib documentation - fromlines = open(actual, "U").readlines() - tolines = open(reference, "U").readlines() + fromlines = open(actual).readlines() + tolines = open(reference).readlines() context_lines = 3 # number of context lines # TODO: filenames are set to "actual" and "reference", isn't it too general? # it is even more useful if map names or file names are some generated