EmilyDirsh / hotwire-shell

Automatically exported from code.google.com/p/hotwire-shell
Other
0 stars 0 forks source link

hotwire_ui does not cope with getdefaultlocale returning None #182

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Find a system where locale.getdefaultlocate() returns (None,None)
2. Read the hotwire error messages when locale_encoding is accessed
3.

What is the expected output? What do you see instead?
I expect not to see error messages, but see error messages instead.

What version of the product are you using? On what operating system?
Hotwire-0.721 under Linux (with python-2.5.2)

Please provide any additional information below.

The error message generated was:
  File "/usr/lib/python2.5/site-packages/hotwire_ui/renderers/unicode.py",
line 141, in __init__
    if locale_encoding.lower() == 'utf-8':
AttributeError: 'NoneType' object has no attribute 'lower'

For getdefaultlocale, the python docs say "language code and encoding may
be None if their values cannot be determined."  As such, if locale_encoding
is None, we probably can't have a decoder, so don't set one.  The patch
attached seems to solve the problem for me.

Please let me know if I can provide any further information...  5:)

Original issue reported on code.google.com by mike.auty@gmail.com on 16 Apr 2008 at 10:12

Attachments:

GoogleCodeExporter commented 9 years ago
This one looks like it was fixed by a (different) patch from issue 175.  Thanks 
for
the patch though, the fix should be in the next release.

Original comment by cgwalt...@gmail.com on 4 May 2008 at 3:40