ulauncher-albert-calculate-anything: Extension stopped converting: 'currency' is not defined in the unit registry

Hey,

The extension stopped working a few days ago. I’ve tried multiple conversions but I get no result with any of them.

In the console I have this error: pint.errors.UndefinedUnitError: 'currency' is not defined in the unit registry

Thank you!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 4
  • Comments: 16 (1 by maintainers)

Most upvoted comments

Same here and it was working well before I tried today. I’m using “internal”.

Here’s the python traceback:

Traceback (most recent call last):
  File "/home/max/.local/share/albert/org.albert.extension.python/modules/calculate-anything/calculate_anything/query/handlers/multi_handler.py", line 55, in _handle
    result = handler.handle(query)
  File "/home/max/.local/share/albert/org.albert.extension.python/modules/calculate-anything/calculate_anything/query/handlers/base.py", line 23, in _wrapper
    return func(self, query, *args, **kwargs)
  File "/home/max/.local/share/albert/org.albert.extension.python/modules/calculate-anything/calculate_anything/query/handlers/base.py", line 57, in handle
    return self.handle_raw(query, *args, **kwargs)
  File "/home/max/.local/share/albert/org.albert.extension.python/modules/calculate-anything/calculate_anything/query/handlers/units.py", line 240, in handle_raw
    with ureg.context('currency'):
  File "/usr/lib/python3.10/contextlib.py", line 135, in __enter__
    return next(self.gen)
  File "/home/max/.local/lib/python3.10/site-packages/pint/facets/context/registry.py", line 301, in context
    self.enable_contexts(*names, **kwargs)
  File "/home/max/.local/lib/python3.10/site-packages/pint/facets/context/registry.py", line 242, in enable_contexts
    self._switch_context_cache_and_units()
  File "/home/max/.local/lib/python3.10/site-packages/pint/facets/context/registry.py", line 151, in _switch_context_cache_and_units
    self._redefine(definition)
  File "/home/max/.local/lib/python3.10/site-packages/pint/facets/context/registry.py", line 175, in _redefine
    dims_old = self._get_dimensionality(basedef.reference)
  File "/home/max/.local/lib/python3.10/site-packages/pint/facets/plain/registry.py", line 660, in _get_dimensionality
    self._get_dimensionality_recurse(input_units, 1, accumulator)
  File "/home/max/.local/lib/python3.10/site-packages/pint/facets/plain/registry.py", line 681, in _get_dimensionality_recurse
    reg = self._units[self.get_name(key)]
  File "/home/max/.local/lib/python3.10/site-packages/pint/facets/plain/registry.py", line 588, in get_name
    raise UndefinedUnitError(name_or_alias)
pint.errors.UndefinedUnitError: 'currency' is not defined in the unit registry

I’ve grown annoyed with this issue, so for converting currencies I’m using currency 🤷 🤫

@tchar Conversion works now. Thank you so much for fixing this!

Is there any update on this? I really miss using this extension

It doesn’t work with internal or fixer.io. But not only currency is buggy the measures and other conversions doesn’t work to

Same problem here. Not only corrency but others units to. Like celsius to fahrenheit and others.