hobeika / key-mon

Automatically exported from code.google.com/p/key-mon
Apache License 2.0
0 stars 0 forks source link

Keymon 1.15-1 not opening in ubuntu 12.10 64-bit #125

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
i using ubuntu 12.10 64 bit i tried all latest versions including the ubuntu 
software center versionnone of them working, but when i try to open in terminal 
i got the following error.

"Traceback (most recent call last):
File "/usr/bin/key-mon", line 3, in <module>
km.main()
File "/usr/lib/pymodules/python2.7/keymon/key_mon.py", line 1032, in main
keymon = KeyMon(opts)
File "/usr/lib/pymodules/python2.7/keymon/key_mon.py", line 123, in __init__
self.enabled = dict([(img, self.get_option(cstrf(img.lower))) for img in 
self.IMAGES])
File "/usr/lib/pymodules/python2.7/keymon/key_mon.py", line 80, in cstrf
locale.setlocale(locale.LC_CTYPE, OLD_CTYPE)
File "/usr/lib/python2.7/locale.py", line 547, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting"

"locale"
LANG=en_IN
LANGUAGE=en_IN:en
LC_CTYPE="en_IN"
LC_NUMERIC="en_IN"
LC_TIME="en_IN"
LC_COLLATE="en_IN"
LC_MONETARY="en_IN"
LC_MESSAGES="en_IN"
LC_PAPER="en_IN"
LC_NAME="en_IN"
LC_ADDRESS="en_IN"
LC_TELEPHONE="en_IN"
LC_MEASUREMENT="en_IN"
LC_IDENTIFICATION="en_IN"
LC_ALL=

"locale -a"

C
C.UTF-8
en_AG
en_AG.utf8
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_IN.utf8
en_NG
en_NG.utf8
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZM
en_ZM.utf8
en_ZW.utf8
POSIX
zh_CN.utf8
zh_SG.utf8

Original issue reported on code.google.com by darknigh...@gmail.com on 16 Jan 2013 at 2:02

GoogleCodeExporter commented 8 years ago
Haven't seen that before...
What language/country is your machine set for ?

Original comment by sc...@forusers.com on 16 Jan 2013 at 11:30

GoogleCodeExporter commented 8 years ago
Nevermind, I see that you output locale and you must be in India.

Original comment by sc...@forusers.com on 16 Jan 2013 at 11:32

GoogleCodeExporter commented 8 years ago
I've uploaded version 1.16, why don't you give that a try it might fix your 
issue.

Original comment by sc...@forusers.com on 16 Jan 2013 at 11:51

GoogleCodeExporter commented 8 years ago
I can reproduce the issue with "en_IN" locale and the problem seems to be 
encoding (charmap).

    locale.getlocale(locale.LC_CTYPE)

returns

    ('en_IN', 'ISO8859-1')

That encoding definitely is not the right one for Indian language. If I 
manually override it in keymon code to be 'UTF-8', the error is gone.

I searched 'en_IN' and there seems to have some problems with that locale, not 
just our keymon. "en_IN.utf8" has no problems, keymon can run with it happily. 
I don't think it's fixable in keymon since the problem isn't in keymon.

Is there a particular reason that your system is set to "en_IN"? Can you try to 
switch to "en_IN.utf8" and see if that works normally on your system?

Original comment by livibet...@gmail.com on 17 Jan 2013 at 3:21

GoogleCodeExporter commented 8 years ago
Hi livibetter,
You may have missed that I think I fixed the issue already.
Instead of using locale.getlocale(locale.LC_TYPE) I'm using 
locale.setlocale(locale.LC_TYPE, None) and using setlocale's returned value for 
the current locale.
I think the bug comes from:
http://bugs.python.org/issue1699853

and that's where I got this work around from.

Original comment by sc...@forusers.com on 17 Jan 2013 at 4:26

GoogleCodeExporter commented 8 years ago
@scott, I see but it's not in the repo and it does fix the problem,
did you forget to push?

Original comment by livibet...@gmail.com on 17 Jan 2013 at 6:53

GoogleCodeExporter commented 8 years ago
Forgot to push, sorry about that.

Original comment by sc...@forusers.com on 17 Jan 2013 at 10:52

GoogleCodeExporter commented 8 years ago
Actually i changed the locale

LANG=en_US.UTF-8
LANGUAGE=en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=en_IN.UTF-8
LC_TIME=en_IN.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=en_IN.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=en_IN.UTF-8
LC_NAME=en_IN.UTF-8
LC_ADDRESS=en_IN.UTF-8
LC_TELEPHONE=en_IN.UTF-8
LC_MEASUREMENT=en_IN.UTF-8
LC_IDENTIFICATION=en_IN.UTF-8
LC_ALL=

after that its working, but now i can't see the en_IN again. thanks for fixing 
the issue.

Original comment by darknigh...@gmail.com on 19 Jan 2013 at 3:36