qreator --help is not working

Bug #1001253 reported by Nicolas Delvaux
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Qreator
Fix Released
Low
David Planella

Bug Description

Qreator installed from https://launchpad.net/qreator/trunk/12.05.4/+download/qreator_12.05.4_all.deb

Here is what I get (right now, I can only test on Debian Testing):

~$ qreator --help
/usr/lib/python2.7/dist-packages/gobject/constants.py:24: Warning: g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed
  import gobject._gobject
Traceback (most recent call last):
  File "/usr/bin/qreator", line 45, in <module>
    qreator.main()
  File "/usr/lib/python2.7/dist-packages/qreator/__init__.py", line 59, in main
    options = parse_options()
  File "/usr/lib/python2.7/dist-packages/qreator/__init__.py", line 52, in parse_options
    (options, args) = parser.parse_args()
  File "/usr/lib/python2.7/optparse.py", line 1399, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/lib/python2.7/optparse.py", line 1439, in _process_args
    self._process_long_opt(rargs, values)
  File "/usr/lib/python2.7/optparse.py", line 1514, in _process_long_opt
    option.process(opt, value, values, self)
  File "/usr/lib/python2.7/optparse.py", line 788, in process
    self.action, self.dest, opt, value, values, parser)
  File "/usr/lib/python2.7/optparse.py", line 810, in take_action
    parser.print_help()
  File "/usr/lib/python2.7/optparse.py", line 1669, in print_help
    file.write(self.format_help().encode(encoding, "replace"))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 186: ordinal not in range(128)

Related branches

Revision history for this message
Nicolas Delvaux (malizor) wrote :

(my locale is fr_FR.utf8)

Revision history for this message
David Planella (dpm) wrote :

Confirmed here too, thanks for reporting it. Will start loking at it.

Changed in qreator:
status: New → Triaged
importance: Undecided → Low
assignee: nobody → David Planella (dpm)
Revision history for this message
David Planella (dpm) wrote :

It seems to be due to this bug in the upstream optparse Python module: http://bugs.python.org/issue2931

I can't think of a workaround, any help will be welcome!

Changed in qreator:
assignee: David Planella (dpm) → nobody
Changed in qreator:
assignee: nobody → Nicolas Delvaux (malizor)
status: Triaged → In Progress
Revision history for this message
David Planella (dpm) wrote :

Wow, many thanks Nicolas for the fix!

I've just hit another issue [1] when trying to submit Qreator through the app developer process. It seems that while the regular package is fine, the package created for the app dev process does not load the translations, as it needs to install them under /opt instead of in the regular directories.

I can't see an obvious fix, but I'm hoping there might be a workaround, which might quite possibly touch the gettext initialization bits, so if you don't mind, I'd like to put your merge proposal on hold until I've figured it out.

[1] http://askubuntu.com/questions/140552/how-to-make-glade-load-translations-from-opt

Revision history for this message
Nicolas Delvaux (malizor) wrote : Re: [Bug 1001253] Re: qreator --help is not working

Perhaps you could try this:

import gettext
gettext.install('qreator',
localedir='/opt/extras.ubuntu.com/qreator/share/locale/', unicode=True)

Disclaimer: I did not test

Revision history for this message
David Planella (dpm) wrote :

Unfortunately that did not work. I've added a comment to the merge proposal. Thanks for your help!

David Planella (dpm)
Changed in qreator:
status: In Progress → Fix Committed
assignee: Nicolas Delvaux (malizor) → nobody
David Planella (dpm)
Changed in qreator:
milestone: none → 12.08
David Planella (dpm)
Changed in qreator:
assignee: nobody → David Planella (dpm)
David Planella (dpm)
Changed in qreator:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.