csv2ofx icon indicating copy to clipboard operation
csv2ofx copied to clipboard

Fix locale for mapping ubs_ch_fr

Open sphakka opened this issue 5 years ago • 4 comments

Something broke with original locale "fr_CH.utf8": using default "fr_CH" fixes this (LC_NUMERIC only). I also added test data and some doc.

@reubano, I guess I could merge this myself, but let you have a look before.

sphakka avatar Nov 08 '19 15:11 sphakka

Huh, why CI failing? Local tests were OK :-)

sphakka avatar Nov 08 '19 15:11 sphakka

======================================================================
ERROR: Failure: Error (unsupported locale setting)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/nose/failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/imp.py", line 235, in load_module
    return load_source(name, filename, file)
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 693, in _load
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 697, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/home/travis/build/reubano/csv2ofx/csv2ofx/mappings/ubs-ch-fr.py", line 33, in <module>
    locale.setlocale(locale.LC_NUMERIC, 'fr_CH')
  File "/home/travis/virtualenv/python3.5.6/lib/python3.5/locale.py", line 594, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting
----------------------------------------------------------------------
Ran 27 tests in 0.198s
FAILED (errors=1)

reubano avatar Aug 10 '20 15:08 reubano

@reubano, I fixed things but it looks like the Travis-CI environment (locale) is not correctly set, hints here: https://github.com/pytest-dev/pytest/issues/1732, https://github.com/pytest-dev/pytest/issues/1732 -- fr_CH ISO-8859-15 is in my /etc/locale.gen. Not enough github/travis experience to fully understand this, sorry. Plus there's this flake8 vs mccabe conflict (see Issue #78)...

sphakka avatar Jan 16 '21 18:01 sphakka

@reubano, I fixed things and also added a Travis "addon" section to install the FR lang pack (for my ubs-ch-fr mapping). However, it looks like your Travis account is short of credit, so all builds are off: I can't test the lang addon... BTW, what's your preferred way for merging PRs (merge | squash | rebase)?

sphakka avatar Jan 23 '22 20:01 sphakka