Bug 237956 - authconfig (python) crashes when LANG is other then C (ascii)
authconfig (python) crashes when LANG is other then C (ascii)
Product: Fedora
Classification: Fedora
Component: authconfig (Show other bugs)
All Linux
high Severity medium
: ---
: ---
Assigned To: Tomas Mraz
Fedora Extras Quality Assurance
: Reopened
: 248786 312291 (view as bug list)
Depends On:
Blocks: F8Target
  Show dependency treegraph
Reported: 2007-04-26 07:47 EDT by Marcin Garski
Modified: 2008-01-09 17:51 EST (History)
4 users (show)

See Also:
Fixed In Version: authconfig-5.3.19-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-01-09 17:51:48 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Marcin Garski 2007-04-26 07:47:21 EDT
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 10:45:27 EDT
Fixed in rhpl
Comment 2 Marcin Garski 2007-05-09 10:48:27 EDT
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 14:21:26 EDT
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 15:06:55 EDT
Thank you for info. Somebody filed it before me :) (bug 239229).
Comment 5 Jeremy Katz 2007-05-24 16:20:26 EDT
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 16:53:15 EDT
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 17:09:21 EDT
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 17:30:30 EDT
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 17:34:40 EDT
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-19 20:37:56 EDT
*** Bug 248786 has been marked as a duplicate of this bug. ***
Comment 11 Andy Shevchenko 2007-10-01 11:46:19 EDT
*** Bug 312291 has been marked as a duplicate of this bug. ***
Comment 12 Jeremy Katz 2007-10-04 11:26:47 EDT
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 08:59:28 EDT
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 17:51:48 EST
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.