-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Locale error on OSX #12
Comments
I'm not yet familiar enough with dabo to provide a patch for this (I've only been playing with it for a couple of hours), but I'll poke around in the UI code when I next have some free time (if this hasn't already been fixed by then) to see what I can come up with. |
That sounds wrong. Shouldn't it be |
Probably, but OSX's default for |
Again, I'm also experiencing locale issues on Mavericks. I realized the problem is the locale directory cannot be found. It only exists under Maybe the locale should be able to find the dabo's locale automatically somehow. |
I realized the last commit is the culprit for the The last changes in the I got it back to normal by manually using the previous version of |
Is this the error? juser@negk: File "", line 17, in File "/tmp/pip_build_juser/dabo/setup.py", line 3, in
http://peak.telecommunity.com/DevCenter/setuptools ImportError: No module named ez_setup Cleaning up... On Wed, May 14, 2014 at 9:17 AM, Carlos [email protected] wrote:
Carl K |
No, I'm pulling the code directly from git and running
in dabo's root directory. I think it failed when I attempted to do I'm also curious, why is the version under |
https://pypi.python.org/pypi/Dabo Dabo-0.9.6.tar.gz is all there is. On Wed, May 14, 2014 at 9:39 AM, Carlos [email protected] wrote:
Carl K |
I tried to install from github using pip:
and when I tried to use dabo, I got:
So yes, there is a problem. I'll look into it when I get a chance. |
(This is the same problem as #11, but it goes a bit deeper.)
OSX sets the environment variable
LC_CTYPE
to"UTF-8"
by default, which Python objects to because it doesn't contain a language. On its own, this isn't too much of a problem because Python usually looks atLC_ALL
first. (Also, if this were the problem the error would belocale.Error: unsupported locale setting
at the point wherelocale.setlocale(locale.LC_ALL, '')
is called.) Because the error is only happening later (when I open a command window, in my case) there must be something setting the locale from outside of Python.I tracked it down to wxWidgets, which calls
setlocale(LC_CTYPE, "UTF-8")
in C++. (Revision 72375 added this.) Since the wxWidgets setup only happens after dabo sets the locale (if it isn't skipped based on settings), it overrides the working locale setting and the next call todabo.getEncoding()
will fail withValueError: unknown locale: UTF-8
.A better solution would be to set the locale again (if configured to do so) after setting up the UI so that all calls to
locale.getlocale()
are safe again. The change in #11 avoids the symptom of the problem in dabo's code, but any calls tolocale.getlocale()
from application code would trigger it. It also risks an encoding mismatch if the default encoding is not UTF-8.The text was updated successfully, but these errors were encountered: