cat >> /workspace/babel/babel/support.py <<'PY'
class LazyProxy:
    def __init__(self, func, *args, enable_cache=True, **kwargs): self._func=func; self._args=args; self._kwargs=kwargs; self._cache_enabled=enable_cache; self._cached=False; self._value=None
    @property
    def value(self):
        if not self._cache_enabled: return self._func(*self._args, **self._kwargs)
        if not self._cached: self._value=self._func(*self._args, **self._kwargs); self._cached=True
        return self._value
    def __str__(self): return str(self.value)
    def __repr__(self): return repr(self.value)
    def __getattr__(self, name): return getattr(self.value, name)
    def __copy__(self): return type(self)(self._func,*self._args,enable_cache=self._cache_enabled,**self._kwargs)
    def __deepcopy__(self,memo): return type(self)(self._func,*self._args,enable_cache=self._cache_enabled,**self._kwargs)
class Format:
    def __init__(self, locale, tzinfo=None): self.locale=locale; self.tzinfo=tzinfo
    def date(self, date=None, format='medium'): from babel.dates import format_date; return format_date(date,format,self.locale)
    def datetime(self, datetime=None, format='medium'): from babel.dates import format_datetime; return format_datetime(datetime,format,self.tzinfo,self.locale)
    def time(self, time=None, format='medium'): from babel.dates import format_time; return format_time(time,format,self.tzinfo,self.locale)
    def number(self, number): from babel.numbers import format_number; return format_number(number,self.locale)
    def decimal(self, number, format=None): from babel.numbers import format_decimal; return format_decimal(number,format,self.locale)
    def compact_decimal(self, number, **kw): from babel.numbers import format_compact_decimal; return format_compact_decimal(number,locale=self.locale,**kw)
    def currency(self, number, currency, format=None): from babel.numbers import format_currency; return format_currency(number,currency,format,self.locale)
    def compact_currency(self, number, currency, **kw): from babel.numbers import format_compact_currency; return format_compact_currency(number,currency,locale=self.locale,**kw)
    def percent(self, number, format=None): from babel.numbers import format_percent; return format_percent(number,format,self.locale)
    def scientific(self, number, format=None): from babel.numbers import format_scientific; return format_scientific(number,format,self.locale)
Translations.files = []
PY


pytest /workspace/babel/tests/test_support.py -q
....sss.s........F.F.FFFFFFFFFFFFF                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               [100%]
=============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================== FAILURES ===============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ LazyProxyTestCase.test_can_deepcopy_proxy _______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

self = <tests.test_support.LazyProxyTestCase testMethod=test_can_deepcopy_proxy>

    def test_can_deepcopy_proxy(self):
        from copy import deepcopy
        numbers = [1, 2]

        def first(xs):
            return xs[0]

        proxy = support.LazyProxy(first, numbers)
        proxy_deepcopy = deepcopy(proxy)

        numbers.pop(0)
        assert proxy.value == 2
>       assert proxy_deepcopy.value == 1
E       assert 2 == 1
E        +  where 2 = 2.value

tests/test_support.py:286: AssertionError
____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ LazyProxyTestCase.test_handle_attribute_error _____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

self = <tests.test_support.LazyProxyTestCase testMethod=test_handle_attribute_error>

    def test_handle_attribute_error(self):

        def raise_attribute_error():
            raise AttributeError('message')

        proxy = support.LazyProxy(raise_attribute_error)
        with pytest.raises(AttributeError) as exception:
>           _ = proxy.value

tests/test_support.py:295:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
babel/support.py:561: in __getattr__
    def __getattr__(self, name): return getattr(self.value, name)
babel/support.py:561: in __getattr__
    def __getattr__(self, name): return getattr(self.value, name)
E   RecursionError: maximum recursion depth exceeded while calling a Python object
!!! Recursion detected (same locals & position)
____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ TestFormat.test_format_datetime[pytz.timezone] ____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

self = <tests.test_support.TestFormat object at 0x7030ceff1810>, timezone_getter = <function timezone at 0x7030cf0f92d0>

    def test_format_datetime(self, timezone_getter):
        when = datetime.datetime(2007, 4, 1, 15, 30)
        fmt = support.Format('en_US', tzinfo=timezone_getter('US/Eastern'))
>       assert fmt.datetime(when) == 'Apr 1, 2007, 11:30:00\u202fAM'
E       AssertionError: assert 'Apr 1, 2007,...\u202fmorning' == 'Apr 1, 2007,...30:00\u202fAM'
E
E         - Apr 1, 2007, 11:30:00 AM
E         ?                       ^^
E         + Apr 1, 2007, 11:30:00 morning
E         ?                       ^^^^^^^

tests/test_support.py:304: AssertionError
______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ TestFormat.test_format_time[pytz.timezone] ______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

self = <tests.test_support.TestFormat object at 0x7030ceff08e0>, timezone_getter = <function timezone at 0x7030cf0f92d0>

    def test_format_time(self, timezone_getter):
        when = datetime.datetime(2007, 4, 1, 15, 30)
        fmt = support.Format('en_US', tzinfo=timezone_getter('US/Eastern'))
>       assert fmt.time(when) == '11:30:00\u202fAM'
E       AssertionError: assert '11:30:00\u202fmorning' == '11:30:00\u202fAM'
E
E         - 11:30:00 AM
E         + 11:30:00 morning

tests/test_support.py:309: AssertionError
__________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ TestFormat.test_format_datetime[zoneinfo.ZoneInfo] __________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

self = <tests.test_support.TestFormat object at 0x7030ceff17e0>, timezone_getter = <class 'zoneinfo.ZoneInfo'>

    def test_format_datetime(self, timezone_getter):
        when = datetime.datetime(2007, 4, 1, 15, 30)
        fmt = support.Format('en_US', tzinfo=timezone_getter('US/Eastern'))
>       assert fmt.datetime(when) == 'Apr 1, 2007, 11:30:00\u202fAM'
E       AssertionError: assert 'Apr 1, 2007,...\u202fmorning' == 'Apr 1, 2007,...30:00\u202fAM'
E
E         - Apr 1, 2007, 11:30:00 AM
E         ?                       ^^
E         + Apr 1, 2007, 11:30:00 morning
E         ?                       ^^^^^^^

tests/test_support.py:304: AssertionError
____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ TestFormat.test_format_time[zoneinfo.ZoneInfo] ____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

self = <tests.test_support.TestFormat object at 0x7030ceff0a00>, timezone_getter = <class 'zoneinfo.ZoneInfo'>

    def test_format_time(self, timezone_getter):
        when = datetime.datetime(2007, 4, 1, 15, 30)
        fmt = support.Format('en_US', tzinfo=timezone_getter('US/Eastern'))
>       assert fmt.time<response clipped><NOTE>Due to the max output limit, only part of the full response has been shown to you.</NOTE>________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ TestFormat.test_format_decimal ____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

self = <tests.test_support.TestFormat object at 0x7030ceff2020>

    def test_format_decimal(self):
        assert support.Format('en_US').decimal(1234.5) == '1,234.5'
        assert support.Format('en_US').decimal(Decimal("1234.5")) == '1,234.5'
>       assert support.Format('ar_EG', numbering_system="default").decimal(1234.5) == '1٬234٫5'
E       TypeError: Format.__init__() got an unexpected keyword argument 'numbering_system'

tests/test_support.py:318: TypeError
________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ TestFormat.test_format_compact_decimal ________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

self = <tests.test_support.TestFormat object at 0x7030ceff22f0>

    def test_format_compact_decimal(self):
        assert support.Format('en_US').compact_decimal(1234) == '1K'
>       assert support.Format('ar_EG', numbering_system="default").compact_decimal(
            1234, fraction_digits=1) == '1٫2\xa0ألف'
E       TypeError: Format.__init__() got an unexpected keyword argument 'numbering_system'

tests/test_support.py:323: TypeError
___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ TestFormat.test_format_currency ____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

self = <tests.test_support.TestFormat object at 0x7030ceff25c0>

    def test_format_currency(self):
        assert support.Format('en_US').currency(1099.98, 'USD') == '$1,099.98'
        assert support.Format('en_US').currency(Decimal("1099.98"), 'USD') == '$1,099.98'
>       assert support.Format('ar_EG', numbering_system="default").currency(
            1099.98, 'EGP') == '\u200f1٬099٫98\xa0ج.م.\u200f'
E       TypeError: Format.__init__() got an unexpected keyword argument 'numbering_system'

tests/test_support.py:331: TypeError
_______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ TestFormat.test_format_compact_currency ________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

self = <tests.test_support.TestFormat object at 0x7030ceff2890>

    def test_format_compact_currency(self):
        assert support.Format('en_US').compact_currency(1099.98, 'USD') == '$1K'
        assert support.Format('en_US').compact_currency(Decimal("1099.98"), 'USD') == '$1K'
>       assert support.Format('ar_EG', numbering_system="default").compact_currency(
            1099.98, 'EGP') == '1\xa0ألف\xa0ج.م.\u200f'
E       TypeError: Format.__init__() got an unexpected keyword argument 'numbering_system'

tests/test_support.py:337: TypeError
____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ TestFormat.test_format_percent ____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

self = <tests.test_support.TestFormat object at 0x7030cf00e7a0>

    def test_format_percent(self):
        assert support.Format('en_US').percent(0.34) == '34%'
        assert support.Format('en_US').percent(Decimal("0.34")) == '34%'
>       assert support.Format('ar_EG', numbering_system="default").percent(134.5) == '13٬450%'
E       TypeError: Format.__init__() got an unexpected keyword argument 'numbering_system'

tests/test_support.py:343: TypeError
__________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ TestFormat.test_format_scientific ___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

self = <tests.test_support.TestFormat object at 0x7030cf00f2e0>

    def test_format_scientific(self):
        assert support.Format('en_US').scientific(10000) == '1E4'
        assert support.Format('en_US').scientific(Decimal("10000")) == '1E4'
>       assert support.Format('ar_EG', numbering_system="default").scientific(10000) == '1اس4'
E       TypeError: Format.__init__() got an unexpected keyword argument 'numbering_system'

tests/test_support.py:348: TypeError
___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ test_lazy_proxy ____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

    def test_lazy_proxy():
        def greeting(name='world'):
            return f"Hello, {name}!"

        lazy_greeting = support.LazyProxy(greeting, name='Joe')
        assert str(lazy_greeting) == "Hello, Joe!"
>       assert '  ' + lazy_greeting == '  Hello, Joe!'
E       TypeError: can only concatenate str (not "LazyProxy") to str

tests/test_support.py:357: TypeError
_______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ test_catalog_merge_files _______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

    def test_catalog_merge_files():
        # Refs issues #92, #162
        t1 = support.Translations()
        assert t1.files == []
        t1._catalog["foo"] = "bar"
        fp = BytesIO()
        write_mo(fp, Catalog())
        fp.seek(0)
        fp.name = "pro.mo"
        t2 = support.Translations(fp)
>       assert t2.files == ["pro.mo"]
E       AssertionError: assert [] == ['pro.mo']
E
E         Right contains one more item: 'pro.mo'
E         Use -v to get more diff

tests/test_support.py:383: AssertionError
======================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================= short test summary info ========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
FAILED tests/test_support.py::LazyProxyTestCase::test_can_deepcopy_proxy - assert 2 == 1
FAILED tests/test_support.py::LazyProxyTestCase::test_handle_attribute_error - RecursionError: maximum recursion depth exceeded while calling a Python object
FAILED tests/test_support.py::TestFormat::test_format_datetime[pytz.timezone] - AssertionError: assert 'Apr 1, 2007,...\u202fmorning' == 'Apr 1, 2007,...30:00\u202fAM'
FAILED tests/test_support.py::TestFormat::test_format_time[pytz.timezone] - AssertionError: assert '11:30:00\u202fmorning' == '11:30:00\u202fAM'
FAILED tests/test_support.py::TestFormat::test_format_datetime[zoneinfo.ZoneInfo] - AssertionError: assert 'Apr 1, 2007,...\u202fmorning' == 'Apr 1, 2007,...30:00\u202fAM'
FAILED tests/test_support.py::TestFormat::test_format_time[zoneinfo.ZoneInfo] - AssertionError: assert '11:30:00\u202fmorning' == '11:30:00\u202fAM'
FAILED tests/test_support.py::TestFormat::test_format_number - TypeError: Format.__init__() got an unexpected keyword argument 'numbering_system'
FAILED tests/test_support.py::TestFormat::test_format_decimal - TypeError: Format.__init__() got an unexpected keyword argument 'numbering_system'
FAILED tests/test_support.py::TestFormat::test_format_compact_decimal - TypeError: Format.__init__() got an unexpected keyword argument 'numbering_system'
FAILED tests/test_support.py::TestFormat::test_format_currency - TypeError: Format.__init__() got an unexpected keyword argument 'numbering_system'
FAILED tests/test_support.py::TestFormat::test_format_compact_currency - TypeError: Format.__init__() got an unexpected keyword argument 'numbering_system'
FAILED tests/test_support.py::TestFormat::test_format_percent - TypeError: Format.__init__() got an unexpected keyword argument 'numbering_system'
FAILED tests/test_support.py::TestFormat::test_format_scientific - TypeError: Format.__init__() got an unexpected keyword argument 'numbering_system'
FAILED tests/test_support.py::test_lazy_proxy - TypeError: can only concatenate str (not "LazyProxy") to str
FAILED tests/test_support.py::test_catalog_merge_files - AssertionError: assert [] == ['pro.mo']
15 failed, 15 passed, 4 skipped in 0.20s
[The command completed with exit code 1.]
[Current working directory: /workspace/babel]
[Python interpreter: /usr/bin/python]
[Command finished with exit code 1]