From 38cb767c7294fbd3aed125fcd88becf698a9ac88 Mon Sep 17 00:00:00 2001 From: Venugopal Shivashankar Date: Wed, 3 Jan 2018 12:18:03 +0100 Subject: pysideinclude.py: Fix reading included files Doc: 'make apidoc' fails while reading lines from a qml file (Python 3). Apparently, the python code that reads the rsts and the corresponding snippet qml files, uses a stream reader that needs a byte stream and not a decoded string. Otherwise, the build fails with the following error: TypeError: can't concat str to bytes Task-number: PYSIDE-363 Change-Id: I84f97f2be37f9e81bca312013b49fad3a7d984c2 Reviewed-by: Friedemann Kleint --- sources/pyside2/doc/pysideinclude.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sources/pyside2/doc/pysideinclude.py') diff --git a/sources/pyside2/doc/pysideinclude.py b/sources/pyside2/doc/pysideinclude.py index f57717622..91fffe115 100644 --- a/sources/pyside2/doc/pysideinclude.py +++ b/sources/pyside2/doc/pysideinclude.py @@ -67,7 +67,7 @@ class PySideInclude(Directive): encoding = self.options.get('encoding', env.config.source_encoding) codec_info = codecs.lookup(encoding) try: - f = codecs.StreamReaderWriter(open(fn, 'U'), + f = codecs.StreamReaderWriter(open(fn, 'Ub'), codec_info[2], codec_info[3], 'strict') lines = f.readlines() f.close() -- cgit v1.2.3