Bug 237956 - authconfig (python) crashes when LANG is other then C (ascii)
Summary: authconfig (python) crashes when LANG is other then C (ascii)
Alias: None
Product: Fedora
Classification: Fedora
Component: authconfig
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Tomas Mraz
QA Contact: Fedora Extras Quality Assurance
: 248786 312291 (view as bug list)
Depends On:
Blocks: F8Target
TreeView+ depends on / blocked
Reported: 2007-04-26 11:47 UTC by Marcin Garski
Modified: 2008-01-09 22:51 UTC (History)
4 users (show)

Fixed In Version: authconfig-5.3.19-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2008-01-09 22:51:48 UTC

Attachments (Terms of Use)

Description Marcin Garski 2007-04-26 11:47:21 UTC
Description of problem:
I try to execute authconfig but it fails with traceback.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Run LANG=pl_PL.UTF-8 authconfig
Actual results:
Traceback (most recent call last):
  File "/usr/sbin/authconfig", line 778, in <module>
  File "/usr/sbin/authconfig", line 356, in run
  File "/usr/sbin/authconfig", line 237, in parseOptions
  File "/usr/lib/python2.5/optparse.py", line 1378, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/lib/python2.5/optparse.py", line 1422, in _process_args
    self._process_short_opts(rargs, values)
  File "/usr/lib/python2.5/optparse.py", line 1529, in _process_short_opts
    option.process(opt, value, values, self)
  File "/usr/lib/python2.5/optparse.py", line 782, in process
    self.action, self.dest, opt, value, values, parser)
  File "/usr/lib/python2.5/optparse.py", line 804, in take_action
  File "/usr/lib/python2.5/optparse.py", line 1648, in print_help
    file.write(self.format_help().encode(encoding, "replace"))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 8: ordinal
not in range(128)

Additional info:
LANG=C authconfig does work.

Similar bug (maybe the same I don't remember) occur during Fedora 7 install,
when anaconda crashed in pl_PL.UTF-8 locale but when I selected en_US.UTF-8
installation went fine.

Comment 1 Jeremy Katz 2007-04-26 14:45:27 UTC
Fixed in rhpl

Comment 2 Marcin Garski 2007-05-09 14:48:27 UTC
With rhpl-0.205-1 authconfig works fine, but there is problem with smolt (LANG=C
 smoltSendProfile resolves it)

Traceback (most recent call last):
  File "/usr/bin/smoltSendProfile", line 102, in <module>
    print profile.getProfile()
  File "/usr/share/smolt/client/smolt.py", line 379, in getProfile
    printBuffer.append('\t%s: %s' % (label, data))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 14: ordinal
not in range(128)

Comment 3 Jeremy Katz 2007-05-09 18:21:26 UTC
That's actually a bug in smolt; it needs to use unicode strings appropriately. 
So you'll need to file something separate for it.

Comment 4 Marcin Garski 2007-05-09 19:06:55 UTC
Thank you for info. Somebody filed it before me :) (bug 239229).

Comment 5 Jeremy Katz 2007-05-24 20:20:26 UTC
The fix here is breaking things more than it's actually helping...  I'm goign to
have to revert it and then we'll come back for F8.  Realistically, a number of
things throughout the stack need to be more pythonic with their utf8 handling --
starting with rhpl and newt and then going onwards from there.

Luckily, the only things that will be broken with the current code:
1) optparser help (this case) 
2) Other things that end up doing explicit encoding of the output on stdout,
which isn't that common

Comment 6 Marcin Garski 2007-05-24 20:53:15 UTC
If you revert this AFAIR anaconda will crash during install (so I'm hoping you
won't revert it before F7 release).

Comment 7 Jeremy Katz 2007-05-24 21:09:21 UTC
No, with this, anaconda crashes.  There was previously a different bug (same
symptom) in anaconda, but that was resolved a little differently.

Comment 8 Marcin Garski 2007-05-24 21:30:30 UTC
Good to hear that there was a different bug. Fedora 8 Blocker is fine for me :)
Do you plan to resolve it and push updates for F7, or only fix it in F8?

Comment 9 Jeremy Katz 2007-05-24 21:34:40 UTC
Depends on how the fix ends up looking -- if it's something that can be safely
pushed back to F7, we definitely will.  But I'm not 100% sure how the fix is
going to look at this point, which makes it hard to say.

Comment 10 Jeremy Katz 2007-07-20 00:37:56 UTC
*** Bug 248786 has been marked as a duplicate of this bug. ***

Comment 11 Andy Shevchenko 2007-10-01 15:46:19 UTC
*** Bug 312291 has been marked as a duplicate of this bug. ***

Comment 12 Jeremy Katz 2007-10-04 15:26:47 UTC
This needs to be fixed by authconfig switching to using python's gettext module
rather than rhpl.translate.

Comment 13 Tomas Mraz 2007-10-17 12:59:28 UTC
I've tried replacing rhpl.translate with gettext from python and it doesn't seem
to help. Are some other changes necessary?

Comment 14 Tomas Mraz 2008-01-09 22:51:48 UTC
Fixed using a modified patch written originally by Andy Shevchenko.

Note You need to log in before you can comment on or make changes to this bug.