pasaffe crashed with UnicodeDecodeError in print_help(): 'ascii' codec can't decode byte 0xd0 in position 178: ordinal not in range(128)

Bug #983210 reported by Karma Dorje
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pasaffe
Fix Released
Undecided
Unassigned
pasaffe (Ubuntu)
Fix Released
Undecided
Marc Deslauriers
Precise
Fix Released
Undecided
Marc Deslauriers
Quantal
Fix Released
Undecided
Marc Deslauriers

Bug Description

just run the program with any arguments from the command line. for example pasaffe -h.

program should be able to filter and handle such events. imho.

ProblemType: Crash
DistroRelease: Ubuntu 12.04
Package: pasaffe 0.16-0ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-23.36lp922906v201204101802-generic 3.2.14
Uname: Linux 3.2.0-23-generic x86_64
ApportVersion: 2.0.1-0ubuntu3
Architecture: amd64
CrashCounter: 1
Date: Tue Apr 17 00:07:09 2012
ExecutablePath: /usr/bin/pasaffe
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
InterpreterPath: /usr/bin/python2.7
PackageArchitecture: all
ProcCmdline: /usr/bin/python /usr/bin/pasaffe -h
PythonArgs: ['/usr/bin/pasaffe', '-h']
SourcePackage: pasaffe
Title: pasaffe crashed with UnicodeDecodeError in print_help(): 'ascii' codec can't decode byte 0xd0 in position 178: ordinal not in range(128)
UpgradeStatus: Upgraded to precise on 2012-03-03 (44 days ago)
UserGroups: adm admin cdrom dialout dip lpadmin plugdev sambashare sudo

Revision history for this message
Karma Dorje (taaroa) wrote :
tags: removed: need-duplicate-check
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Hrm, I can't reproduce this. Does it happen if you use LANG=C?

visibility: private → public
Revision history for this message
Karma Dorje (taaroa) wrote :

if i use LANG=C the result is the same, but it does not generate a report (apport-crash).

% LANG=C pasaffe -h
Traceback (most recent call last):
  File "/usr/bin/pasaffe", line 44, in <module>
    pasaffe.main()
  File "/usr/lib/python2.7/dist-packages/pasaffe/__init__.py", line 58, in main
    options = parse_options()
  File "/usr/lib/python2.7/dist-packages/pasaffe/__init__.py", line 39, 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 1443, in _process_args
    self._process_short_opts(rargs, values)
  File "/usr/lib/python2.7/optparse.py", line 1550, in _process_short_opts
    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 0xd0 in position 178: ordinal not in range(128)

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

OK, I've found the cause, and have commited a fix to bzr.

Changed in pasaffe:
status: New → Confirmed
status: Confirmed → Fix Committed
Changed in pasaffe (Ubuntu Precise):
status: New → Confirmed
assignee: nobody → Marc Deslauriers (mdeslaur)
Changed in pasaffe:
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pasaffe - 0.17-0ubuntu1

---------------
pasaffe (0.17-0ubuntu1) quantal; urgency=low

  * New upstream release
   - Add command-line option to specify default database
   - Don't save database specified on command line as default
   - Properly handle entries that have no URL specified (LP: #980608)
   - Fix logging in pasaffe-import scripts so we can debug failures
     (LP: #991143)
   - Correctly strip gpass database padding (LP: #991204)
   - Properly handle unicode characters with optparse (LP: #983210)
 -- Marc Deslauriers <email address hidden> Thu, 03 May 2012 20:37:15 -0400

Changed in pasaffe (Ubuntu Quantal):
status: Confirmed → Fix Released
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

SRU Request:

[Impact]
Cannot view options from the command line with -h if an alternate language is used that contains UTF-8 characters.

[Development Fix]
Quantal has been fixed by updating to version 0.17 that contains the fix for this issue

[Stable Fix]
See attached patch for minimal fix for this issue.

[Test Case]
1- Launch Pasaffe from the command line with "LANGUAGE=fr_CA.UTF-8 pasaffe" and see if help is displayed.

[Regression Potential]
This fix is limited to the command line. Attempting to fix this all through the application using the same technique yielded some UTF-8 character errors while the application was in use.

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello karma, or anyone else affected,

Accepted pasaffe into precise-proposed. The package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in pasaffe (Ubuntu Precise):
status: Confirmed → Fix Committed
tags: added: verification-needed
Revision history for this message
Karma Dorje (taaroa) wrote :

% pasaffe -test0123
Usage: pasaffe [options]

pasaffe: error: no such option: -t

% LANGUAGE=fr_CA.UTF-8 pasaffe -h
Usage: pasaffe [options]

Options:
  --version show program's version number and exit
  -h, --help show this help message and exit
  -v, --verbose Afficher les messages de déboguage (-vv les affiche
                        également pour pasaffe_lib)
  -f FILE, --file=FILE use database FILE
  -s, --set-default set database as default

% pasaffe --version
pasaffe 0.17

resolved fixed ☺

Martin Pitt (pitti)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pasaffe - 0.16-0ubuntu1.1

---------------
pasaffe (0.16-0ubuntu1.1) precise-proposed; urgency=low

  * debian/patches/lp980608.patch: Don't print an error if trying to open a
    URL when none is set in an entry. (LP: #980608)
  * debian/patches/lp991143.patch: add option to turn on debugging when
    using the pasaffe-import-* scripts. (LP: #991143)
  * debian/patches/lp991204.patch: properly strip gpass database padding.
    (LP: #991204)
  * debian/patches/lp983210.patch: Properly handle unicode chars with
    optparse. (LP: #983210)
 -- Marc Deslauriers <email address hidden> Thu, 03 May 2012 20:13:13 -0400

Changed in pasaffe (Ubuntu Precise):
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.