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日 4時間
- マージ済み PR(30日)
- 98
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
aws-powertools/powertools-lambda-python のほかの issue
-
Bug: POWERTOOLS_IDEMPOTENCY_DISABLED set to an empty or non-boolean value crashes every invocation対応中かも @lechakrawarthy が 2 日前に担当しました。 オープン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 が 2 日前に担当しました。 オープン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 が 2 日前に担当しました。 オープンbug good first issue help wanted idempotency
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
aws-powertools/powertools-lambda-python#8726 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Bug: idempotency payloads with set, frozenset or bytes fields cannot be hashed対応中かも @Neeraj111010 が 2 日前に担当しました。 オープン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 が 2 日前に担当しました。 オープン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
-
Backend issue lists report in-patch warnings and out-of-patch errors as not publishable対応中かも @RaphaelFakhri が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
mozilla/code-review#3794 ·
メンテナーはふだん 1 日以内に返信
-
[oblt-aw][autodoc] Update docs that still describe the security registry as empty対応中かも @github-actions が今日担当しました。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
[Bug] adb backup script reports "Done" & exits 0 when the backup fails対応中かも @bhattmanthan が今日担当しました。 オープンrequest-issue-assignment
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
agent-ui bug p2
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
correction metadata
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
acl-org/acl-anthology#10768 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信