PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: python-babel/babel (python)
Issue: format_timedelta throws a KeyError for the Portuguese locale
## Overview Description

`format_timedelta` throws a KeyError for the Portuguese locale when parsing one hour in short format.

## Steps to Reproduce

```
from datetime import timedelta
from babel.dates import format_timedelta

format_timedelta(timedelta(hours=1), granularity='hour', threshold=100, format='short', locale='pt')
```

## Actual Results
```
Traceback (most recent call last):
  File "/home/user/miniconda3/envs/py38/lib/python3.8/code.py", line 90, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
  File "/home/user/miniconda3/envs/py38/lib/python3.8/site-packages/babel/dates.py", line 952, in format_timedelta
    pattern = patterns[plural_form]
  File "/home/user/miniconda3/envs/py38/lib/python3.8/site-packages/babel/localedata.py", line 238, in __getitem__
    orig = val = self._data[key]
KeyError: 'one'
```

## Expected Results
```
'1 h'
```

## Additional Information

babel version == 2.9.1
Pull request description: Date intervals: allow using `other` as fallback form
Fixes #825

Patch:
diff --git a/babel/dates.py b/babel/dates.py
index a1bf713..816149d 100644
--- a/babel/dates.py
+++ b/babel/dates.py
@@ -948,7 +948,7 @@ def format_timedelta(delta, granularity='second', threshold=.85,
             pattern = None
             for patterns in _iter_patterns(unit):
                 if patterns is not None:
-                    pattern = patterns[plural_form]
+                    pattern = patterns.get(plural_form) or patterns.get('other')
                     break
             # This really should not happen
             if pattern is None:


Test patch:
diff --git a/tests/test_date_intervals.py b/tests/test_date_intervals.py
index 2e5f0d6..4f42170 100644
--- a/tests/test_date_intervals.py
+++ b/tests/test_date_intervals.py
@@ -52,3 +52,13 @@ def test_format_interval_invalid_skeleton():
     t2 = TEST_DATE + datetime.timedelta(days=1)
     assert dates.format_interval(t1, t2, "mumumu", fuzzy=False, locale="fi") == u"8.1.2016\u20139.1.2016"
     assert dates.format_interval(t1, t2, fuzzy=False, locale="fi") == u"8.1.2016\u20139.1.2016"
+
+
+def test_issue_825():
+    assert dates.format_timedelta(
+        datetime.timedelta(hours=1),
+        granularity='hour',
+        threshold=100,
+        format='short',
+        locale='pt',
+    ) == '1 h'