[ovs-dev] [PATCH] Documentation: Fix building with Python 3.9

Timothy Redaelli tredaelli at redhat.com
Thu Jan 16 13:21:47 UTC 2020


open(), io.open(), codecs.open() and fileinput.FileInput no longer accept 'U'
("universal newline") in the file mode.
This flag was deprecated since Python 3.3.
In Python 3, the "universal newline" is used by default when a file is open
in text mode.

Reported-at: https://bugzilla.redhat.com/1791681
Reported-by: Miro Hrončok <mhroncok at redhat.com>
Signed-off-by: Timothy Redaelli <tredaelli at redhat.com>
---
 Documentation/conf.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/conf.py b/Documentation/conf.py
index 6bbfc02bd..37d92c36f 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -58,7 +58,7 @@ author = u'The Open vSwitch Development Community'
 # The full version, including alpha/beta/rc tags.
 release = None
 filename = "../configure.ac"
-with open(filename, 'rU') as f:
+with open(filename, 'r') as f:
     for line in f:
         if 'AC_INIT' in line:
             # Parse "AC_INIT(openvswitch, 2.7.90, bugs at openvswitch.org)":
-- 
2.24.1



More information about the dev mailing list