Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • NetworkManager NetworkManager
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 168
    • Issues 168
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 15
    • Merge requests 15
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • NetworkManager
  • NetworkManagerNetworkManager
  • Merge requests
  • !1249

tools: Fix generate-docs-nm-settings-docs-gir.py on Python 2

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed igo95862 requested to merge igo95862/NetworkManager:fix-python2-generate-docs-nm-settings-docs-gir into main Jun 02, 2022
  • Overview 3
  • Commits 1
  • Changes 1

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:

  1. Change encoding to utf-8
  2. 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 Jun 02, 2022 by igo95862
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: fix-python2-generate-docs-nm-settings-docs-gir