tools: Fix generate-docs-nm-settings-docs-gir.py on Python 2
This a follow up to !1246 (closed)
@thaller found out that build was failing on EPEL7.
On python2 the following error is raised:
LookupError: unknown encoding: unicode
Seems like unicode
is a correct encoding in Python 3 but not 2.
Fix:
- Change encoding to
utf-8
- Pass output path string instead of opening file and passing opened file object. Python2 and 3 might need different file modes, passing just path lets ElementTree select appropriate file mode.
I tested element tree on python2 and it utf-8
seems to work. (I can't test entire build as it would require me to install too many Python 2 dependencies)
Edited by igo95862