Bug 509786 - Non LANG=en_US.UTF-8 locales cause virt-install to bail out.
Summary: Non LANG=en_US.UTF-8 locales cause virt-install to bail out.
Keywords:
Status: CLOSED DUPLICATE of bug 508784
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: python-virtinst
Version: 5.5
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Cole Robinson
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-07-06 08:06 UTC by Wade Mealing
Modified: 2009-12-14 21:19 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-07-06 13:01:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
I'm not sure if this is the best way,but at least it starts. (445 bytes, application/octet-stream)
2009-07-06 08:15 UTC, Wade Mealing
no flags Details

Description Wade Mealing 2009-07-06 08:06:17 UTC
Description of problem:

Running virt-install from Chinese, Japanese or any other non english locale, ends up causing virt-install to fail prematurely.  It bails out due to a bad date format ( as far as I can tell) in the virt-manager, which is passed through to python logging framework.

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

F10, F11, Rawhide, RHEL5.

How reproducible:

Every time.

Steps to Reproduce:
1. Become one with uid 0.
2. export LANG=zh_CN.UTF8
3.# virt-install 
Traceback (most recent call last):
  File "/usr/lib64/python2.6/logging/handlers.py", line 74, in emit
    if self.shouldRollover(record):
  File "/usr/lib64/python2.6/logging/handlers.py", line 145, in shouldRollover
    msg = "%s\n" % self.format(record)
  File "/usr/lib64/python2.6/logging/__init__.py", line 637, in format
    return fmt.format(record)
  File "/usr/lib64/python2.6/logging/__init__.py", line 428, in format
    s = self._fmt % record.__dict__
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 1: ordinal not in range(128)
ERROR    虚拟机需要一个名称。   

I assume the above message says like its english counterpart which is something along the lines of name not specified.
  
Actual results:

Application throws python traceback exception.

Expected results:

Application to not throw an error.

Additional info:

I will attach a patch which attempts to fix the problem, the only downside that I could notice is that the date stamps in the log file$HOME/.virtinstall/virt-install.log were no longer in the native locale.  Error messages remained the same.

Comment 1 Wade Mealing 2009-07-06 08:15:09 UTC
Created attachment 350583 [details]
I'm not sure if this is the best way,but at least it starts.

I found a way to work around this bug by modifying the loggers __init__.py although I'd imagine that it would require considerable QE in comparison to this work around.

Comment 2 Cole Robinson 2009-07-06 13:01:02 UTC
Thanks for the patch. There are actually other problems in this area that need a more complete fix, which are being tracked in bug 508784.

*** This bug has been marked as a duplicate of bug 508784 ***

Comment 3 Wade Mealing 2009-07-07 01:00:47 UTC
Yeah, I figured that was the case.  I have a fix for the logger too, although the solution was a little more complex.

Will transfer IT to this bug, Thanks Cole.


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