jceb / vim-orgmode

Text outlining and task management for Vim based on Emacs' Org-Mode
http://www.vim.org/scripts/script.php?script_id=3642
Other
3.1k stars 266 forks source link

Problem with locale #255

Open leguyader opened 7 years ago

leguyader commented 7 years ago

I had the same problem, i.e. couldn't find the 0.6 download link so I tried compiling from source on freshly installed Ubuntu 16.04 and ran into the following locale problem:

$ make vba
cd tests && python2 run_tests.py
...............................................................................EE.................................................................................................................................................
======================================================================
ERROR: test_OrdDate_str_unicode_active (test_liborgdate_utf8.OrgDateUtf8TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/vim-orgmode/tests/test_liborgdate_utf8.py", line 40, in test_OrdDate_str_unicode_active
    with self.setlocale(self.UTF8_LOCALE):
  File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "/tmp/vim-orgmode/tests/test_liborgdate_utf8.py", line 28, in setlocale
    yield locale.setlocale(locale.LC_ALL, name)
  File "/usr/lib/python2.7/locale.py", line 581, in setlocale
    return _setlocale(category, locale)
Error: unsupported locale setting

======================================================================
ERROR: test_OrdDate_str_unicode_inactive (test_liborgdate_utf8.OrgDateUtf8TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/vim-orgmode/tests/test_liborgdate_utf8.py", line 45, in test_OrdDate_str_unicode_inactive
    with self.setlocale(self.UTF8_LOCALE):
  File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "/tmp/vim-orgmode/tests/test_liborgdate_utf8.py", line 28, in setlocale
    yield locale.setlocale(locale.LC_ALL, name)
  File "/usr/lib/python2.7/locale.py", line 581, in setlocale
    return _setlocale(category, locale)
Error: unsupported locale setting

----------------------------------------------------------------------
Ran 226 tests in 0.436s

FAILED (errors=2)
cd documentation && make clean
make[1]: Entering directory '/tmp/vim-orgmode/documentation'
make[1]: Leaving directory '/tmp/vim-orgmode/documentation'
make DESTDIR=/tmp/vim-orgmode/tmp VIMDIR= install
make[1]: Entering directory '/tmp/vim-orgmode'
for i in doc indent ftdetect ftplugin syntax; do \
    find $i -type f -name \*.txt -o -type f -name \*.cnf -o -type f -name \*.py -o -type f -name \*.vim | while read f; do \
        install -m 0755 -d /tmp/vim-orgmode/tmp/$(dirname "$f"); \
        install -m 0644 $f /tmp/vim-orgmode/tmp/$f; \
    done; \
done
make[1]: Leaving directory '/tmp/vim-orgmode'
find tmp -type f  | sed -e 's/^tmp\///' > files
cp build_vmb.vim tmp
cd tmp && vim --cmd 'let g:plugin_name="orgmode"' -s build_vmb.vim
[ -e tmp/orgmode.vba ] && mv tmp/orgmode.vba tmp/orgmode.vmb || true
mv tmp/orgmode.vmb .
mv orgmode.vmb orgmode.vba

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

Also I mostly have python3 installed so cd tests && python2 run_tests.py probably should be changed somehow. I tried replacing python2 by python3 and get a failure on the same 2 tests so it's not this.

Cheers.

leguyader commented 7 years ago

After reading the source of the two failing tests, I see that they require the locale _ptBR.utf-8 to be installed. I marked both tests as expected failure and could compile.

Cheers.