Bug: SCHEDULE_BETWEEN_DAYS_OF_WEEK stops matching when LC_TIME is not English
維護者通常 1 天內回覆
評估
這個 Issue 還沒有評估資料。
描述
Expected Behaviour
A SCHEDULE_BETWEEN_DAYS_OF_WEEK rule with "DAYS": ["FRIDAY"] matches on Fridays whatever locale the function runs with.
Current Behaviour
compare_days_of_week gets the current day with strftime("%A").upper(), which names the day in the process's LC_TIME locale. If the function calls locale.setlocale(locale.LC_TIME, ...) (or LC_ALL) for a non-English locale, the day comes back as FREITAG, VENDREDI, etc., never equals the English names the schema requires, and every day-of-week rule silently stops matching.
Code snippet
import locale
from aws_lambda_powertools.utilities.feature_flags.comparators import compare_days_of_week
cond = {"DAYS": ["FRIDAY"], "TIMEZONE": "UTC"} # run on a Friday
compare_days_of_week(None, cond) # True
locale.setlocale(locale.LC_TIME, "de_DE.UTF-8")
compare_days_of_week(None, cond) # False, the current day is "FREITAG"
Steps to Reproduce
- Configure a feature flag rule with
SCHEDULE_BETWEEN_DAYS_OF_WEEKand today's day inDAYS. - Set a non-English
LC_TIMEin the function. - Evaluate the flag: the rule no longer matches.
Possible Solution
Look the day up from datetime.weekday() (Monday is 0) instead of formatting its name, so the result does not depend on the locale. I can open a PR.
Powertools for AWS Lambda (Python) version
latest (develop, 3.38.0)
AWS Lambda function runtime
3.12
Packaging format used
PyPi
Debugging logs
No response
- 主要語言
- Python
- 星號
- 3.3k
- 分支
- 511
- 平均合併
- 3 天 13 小時
- 30 天內合併 PR
- 110
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
aws-powertools/powertools-lambda-python 的其他 Issue
-
Bug: POWERTOOLS_IDEMPOTENCY_DISABLED set to an empty or non-boolean value crashes every invocation可能已有人在做 @lechakrawarthy 於 3 天前認領。 未關閉bug good first issue help wanted idempotency
難度 2/5 1-3 小時 新手友好度 85/100
aws-powertools/powertools-lambda-python#8728 · 4 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
Bug: Redis layer fails the invocation instead of retrying when a record expires between SET NX and GET可能已有人在做 @coughlmao 於 3 天前認領。 未關閉bug good first issue help wanted idempotency
難度 2/5 1-3 小時 新手友好度 85/100
aws-powertools/powertools-lambda-python#8727 · 4 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
Bug: Redis orphan lock timeout ignores expires_after_seconds and is always 10 seconds可能已有人在做 @CJstate 於 3 天前認領。 未關閉bug good first issue help wanted idempotency
難度 2/5 1-3 小時 新手友好度 75/100
aws-powertools/powertools-lambda-python#8726 · 4 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
Bug: idempotency payloads with set, frozenset or bytes fields cannot be hashed可能已有人在做 @Neeraj111010 於 3 天前認領。 未關閉bug good first issue help wanted idempotency
難度 2/5 1-3 小時 新手友好度 80/100
aws-powertools/powertools-lambda-python#8725 · 6 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
Bug: with a DynamoDB composite key, DataRecord.idempotency_key is the static partition key value可能已有人在做 @sumedh-aerram 於 3 天前認領。 未關閉bug good first issue help wanted idempotency
難度 2/5 1-3 小時 新手友好度 90/100
aws-powertools/powertools-lambda-python#8724 · 3 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
查看 aws-powertools/powertools-lambda-python 的全部 Issue
相似的 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
area:docs documentation effort:M ready-for-agent
難度 2/5 1-3 小時 新手友好度 76/100
mczielinski/ob-analytics#423 ·
維護者通常 1 天內回覆
-
infra
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 3 天內回覆
-
documentation
難度 2/5 1-3 小時 新手友好度 68/100
vllm-project/vllm-ascend#21033 ·
維護者通常 1 天內回覆