Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • S Solaar
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 10
    • Issues 10
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • pwr-Solaar
  • Solaar
  • Merge requests
  • !525

Fix UnicodeDecodeError with ngettext and python2

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/pdecat/fix-UnicodeDecodeError-ngettext-python2 into master May 05, 2019
  • Overview 1
  • Commits 1
  • Pipelines 0
  • Changes 4

Created by: pdecat

Similar to what's done for gettext but for ngettext.

Without this change, errors like the following occur with the French locale (and maybe others) using python2:

# ./venv/bin/python bin/solaar
Traceback (most recent call last):
  File "/home/patrick/workspaces/Solaar/lib/solaar/ui/window.py", line 382, in _device_selected
    _update_info_panel(device, full=True)
  File "/home/patrick/workspaces/Solaar/lib/solaar/ui/window.py", line 697, in _update_info_panel
    _update_receiver_panel(device, _info._receiver, _info._buttons, full)
  File "/home/patrick/workspaces/Solaar/lib/solaar/ui/window.py", line 574, in _update_receiver_panel
    paired_text += '\n\n<small>%s</small>' % ngettext('Up to %(max_count)s device can be paired to this receiver.', 'Up to %(max_count)s devices can be paired to this receiver.', receiver.max_devices) % { 'max_count': receiver.max_devices }
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 6: ordinal not in range(128)
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/pdecat/fix-UnicodeDecodeError-ngettext-python2