Issue #15204: Deprecated the 'U' mode in file-like objects.
diff --git a/Tools/iobench/iobench.py b/Tools/iobench/iobench.py
index 530bc79..712e584 100644
--- a/Tools/iobench/iobench.py
+++ b/Tools/iobench/iobench.py
@@ -24,6 +24,8 @@
try:
return open(fn, mode, encoding=encoding or TEXT_ENCODING)
except TypeError:
+ if 'r' in mode:
+ mode += 'U' # 'U' mode is needed only in Python 2.x
return open(fn, mode)
def get_file_sizes():
@@ -380,7 +382,7 @@
f.write(os.urandom(size))
# Text files
chunk = []
- with text_open(__file__, "rU", encoding='utf8') as f:
+ with text_open(__file__, "r", encoding='utf8') as f:
for line in f:
if line.startswith("# <iobench text chunk marker>"):
break