Vì vậy, hôm nay tôi nâng cấp lên 2.0.2 Bazaar, và tôi bắt đầu nhận được thông báo này (Tôi đang trên tuyết, btw):lỗi trăn địa phương lạ. những gì đang xảy ra ở đây chính xác?
bzr: warning: unknown locale: UTF-8
Could not determine what text encoding to use.
This error usually means your Python interpreter
doesn't support the locale set by $LANG (en_US.UTF-8)
Continuing with ascii encoding.
rất lạ, vì LANG tôi là thực sự trống rỗng. Điều tương tự xảy ra khi tôi cố gắng để tinker với các module locale
Python 2.5.4 (r254:67916, Nov 30 2009, 14:09:22)
[GCC 4.3.4] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.getdefaultlocale()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/sbo/runtimes/lib/python2.5/locale.py", line 443, in getdefaultlocale
return _parse_localename(localename)
File "/Users/sbo/runtimes/lib/python2.5/locale.py", line 375, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8
xuất khẩu LANG không giúp
[email protected]:~ $ export LANG=en_US.UTF-8
[email protected]:~ $ bzr
bzr: warning: unknown locale: UTF-8
Could not determine what text encoding to use.
This error usually means your Python interpreter
doesn't support the locale set by $LANG (en_US.UTF-8)
Continuing with ascii encoding.
Tuy nhiên, điều này đã giải quyết được vấn đề
[email protected]:~ $ export LANG=en_US.UTF-8
[email protected]:~ $ export LC_ALL=en_US.UTF-8
Python 2.5.4 (r254:67916, Nov 30 2009, 14:09:22)
[GCC 4.3.4] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.getdefaultlocale()
('en_US', 'UTF8')
Ông có thể vui lòng giải thích những gì đang xảy ở đây, để có khả năng tốt hơn?
Mọi thông tin chi tiết khác về sự cố của bạn? –
+1 hai dòng "xuất" đã làm cho "ValueError: locale không xác định: ..." của tôi biến mất. – Bogatyr
Cảm ơn bạn rất nhiều vì hai dòng cuối cùng. Đã lưu tôi và tôi chắc chắn có rất nhiều người dùng Mac khác rất nhiều thời gian. –