Skip to content

fix: treat explicit tzinfo=None in arrow.get() like an omitted tzinfo - #1343

Open
TrueFurina wants to merge 1 commit into
arrow-py:masterfrom
TrueFurina:fix-1259
Open

fix: treat explicit tzinfo=None in arrow.get() like an omitted tzinfo#1343
TrueFurina wants to merge 1 commit into
arrow-py:masterfrom
TrueFurina:fix-1259

Conversation

@TrueFurina

Copy link
Copy Markdown

Fixes #1259

Problem: arrow.get() with an explicit tzinfo=None keyword behaves differently from omitting it: the tzinfo key stays in kwargs (only read via get), so the 'tzinfo kwarg is not provided' branch (len(kwargs) == 1 and tz is None) forces arg_count = 3 and crashes, while omitting the kwarg leaves kwargs empty and parses normally.

Fix: pop tzinfo from kwargs so an explicit None and an omitted tzinfo are treated identically (both leave kwargs without the key).

@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (2224255) to head (565a4d0).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #1343   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines         2315      2315           
  Branches       358       358           
=========================================
  Hits          2315      2315           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

arrow.get() behaviour for tzinfo=None

1 participant