Request for Leopard users

41 views
Skip to first unread message

Malcolm Tredinnick

unread,
Oct 31, 2007, 11:31:37 PM10/31/07
to django...@googlegroups.com
Can anybody using Apple's Leopard OS confirm #5846 exists by default?

This is either a mistake on the part of the reporter or a total bozo bug
on Apple's part. I'd like to establish which.

Thanks,
Malcolm

--
I don't have a solution, but I admire your problem.
http://www.pointy-stick.com/blog/

Steve Lianoglou

unread,
Oct 31, 2007, 11:39:22 PM10/31/07
to Django users
Hi Malcom,

> Can anybody using Apple's Leopard OS confirm #5846 exists by default?

>From what you describe, it looks as if Leopard is doing the correct
thing.

You mention in the ticket comments:

"""
This is really a bug in Leopard. UTF-8 doesn't look like a valid value
for the LANG environment variable. It should be something of the form
language[_territory][.codeset], where UTF-8 is only the codeset part.
"""

This is what I get from the terminal:

[stavros@Macintosh:~]$ echo $LANG
en_US.UTF-8

Which seems kosher (according to language[_territory][.codeset])

I don't have any custom setting in ~/.bashrc (or similar) that's
exporting $LANG into the environment, so ... if I'm not
misunderstanding what's going on here, it might be a mistake on the
poster's part.


-steve

Lavoie Francis

unread,
Oct 31, 2007, 11:44:37 PM10/31/07
to django...@googlegroups.com
I don't know how to reproduce this error.

But If I check the comment :
This is really a bug in Leopard. UTF-8 doesn't look like a valid value for the LANG environment variable. It should be something of the form language[_territory][.codeset], where UTF-8 is only the codeset part.

LANG on my system is set to fr_CA.UTF-8, which is valid.

But python doesn't seems to take it into account, if I import locale and try :

locale.getlocale()
I got : (None, None)


But this with the default python that comes with Leopard. Not the one in macport.



Le 07-10-31 à 23:31, Malcolm Tredinnick a écrit :

Karen Tracey

unread,
Nov 1, 2007, 12:05:42 AM11/1/07
to django...@googlegroups.com
On 10/31/07, Malcolm Tredinnick <mal...@pointy-stick.com> wrote:
Can anybody using Apple's Leopard OS confirm #5846 exists by default?

This is either a mistake on the part of the reporter or a total bozo bug
on Apple's part. I'd like to establish which.

Though I'm not a Leopard user I've seen other reports of this online so my impression is it is a Leopard bug.  This page describes how it's triggered:

http://henrik.nyh.se/2007/10/displaying-utf-8-correctly-in-leopard-terminal

There's a comment with a pointer to a bug report at Apple, but I don't have an account there so can't see if there's been any response to the report.

Karen

Wilson MacGyver

unread,
Nov 1, 2007, 1:50:06 AM11/1/07
to django...@googlegroups.com
I too can confirm this.

echo $LANG gives en_US.UTF-8

but using both /usr/bin/python which is the one that came
with OSX Leopard, or using the MacPython downloaded
from www.python.org at the path
/Library/Frameworks/Python.framework/Versions/Current/bin/python

in both cases,

>>> import locale
>>> locale.getlocale()

outputs

(None, None)


--
Omnem crede diem tibi diluxisse supremum.

Karen Tracey

unread,
Nov 1, 2007, 2:10:19 AM11/1/07
to django...@googlegroups.com
On 11/1/07, Wilson MacGyver <wmac...@gmail.com> wrote:

I too can confirm this.

echo $LANG gives en_US.UTF-8

but using both /usr/bin/python which is the one that came
with OSX Leopard, or using the MacPython downloaded
from www.python.org at the path
/Library/Frameworks/Python.framework/Versions/Current/bin/python

in both cases,

>>> import locale
>>> locale.getlocale()

outputs

(None, None)

That's normal, if you haven't done a setlocale().  It's locale.getdefaultlocale() that takes into account the LANG environment setting. 

Karen

Wilson MacGyver

unread,
Nov 1, 2007, 2:46:50 AM11/1/07
to django...@googlegroups.com
My bad.

using MacPython, I get

>>> import locale
>>> locale.getdefaultlocale()
(None, 'mac-roman')

using the /usr/bin/python that came with leopard though, I get
>>> import locale
>>> locale.getdefaultlocale()
('en_US', 'UTF8')

Malcolm Tredinnick

unread,
Nov 1, 2007, 2:58:29 AM11/1/07
to django...@googlegroups.com
On Thu, 2007-11-01 at 02:46 -0400, Wilson MacGyver wrote:
> My bad.
>
> using MacPython, I get
>
> >>> import locale
> >>> locale.getdefaultlocale()
> (None, 'mac-roman')
>
> using the /usr/bin/python that came with leopard though, I get
> >>> import locale
> >>> locale.getdefaultlocale()
> ('en_US', 'UTF8')

Ok, thanks.

I think we have enough feedback now, everybody. Thanks for the rapid
responses.

I was mostly interested in what LANG was set to; I already believe
Python's locale stuff works correctly. The links Karen found suggest
that it is a Leopard problem, but isn't to affect everybody and it is
possible to work around. So annoying, but not a showstopper.

Malcolm

--
No one is listening until you make a mistake.
http://www.pointy-stick.com/blog/

Reply all
Reply to author
Forward
0 new messages