locale setting fails on Mac OS X
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pylinkgrammar |
New
|
Undecided
|
Unassigned |
Bug Description
When initialising the lp() class on Mac OS, the locale setting fails.
I compiled link-grammar and the python bindings by following the instructions in the FAQ here: https:/
Here is the output of the example script:
$ python example1.py
Traceback (most recent call last):
File "example1.py", line 2, in <module>
parser = lp()
File "/Users/
locale.
File "/System/
return _setlocale(
locale.Error: unsupported locale setting
Cleaning up linkgrammar...
Deleting <class 'linkgrammar.lp'>
Exception AttributeError: 'parse_options' in <bound method lp.__del__ of <linkgrammar.lp object at 0x10049ce10>> ignored
I fixed the problem by enclosing the locale setting in a try block as follows:
try:
locale.
except Exception, e:
print 'Could not set locale:', e
The program then runs and parses the sentence correctly, but gives the output:
Could not set locale: unsupported locale setting
The problem disappears completely if the line is changed to:
locale.
I don't really know what this line does, but should it be fixed some other way?
If this is a problem with my setup or you don't consider this a bug, please convert it to a question or delete it as necessary. I'm using Mac OS X 10.6.4.
Thanks!
Related branches
description: | updated |
description: | updated |
description: | updated |
description: | updated |