Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arrow/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def get(self, *args: Any, **kwargs: Any) -> Arrow:
arg_count = 3

# tzinfo kwarg is not provided
if len(kwargs) == 1 and tz is None:
if len(kwargs) == 1 and "tzinfo" not in kwargs:
arg_count = 3

# () -> now, @ tzinfo or utc
Expand Down
6 changes: 6 additions & 0 deletions tests/test_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,12 @@ def test_tzinfo_string_kwargs(self):
result = self.factory.get("2019072807", "YYYYMMDDHH", tzinfo="UTC")
assert result._datetime == datetime(2019, 7, 28, 7, 0, 0, 0, tzinfo=tz.tzutc())

def test_tzinfo_none_kwargs(self):
# regression test for issue #1259
# passing tzinfo=None explicitly should not raise TypeError
result = self.factory.get("2025-01-01", "YYYY-MM-DD", tzinfo=None)
assert result._datetime == datetime(2025, 1, 1, 0, 0, 0, 0, tzinfo=tz.tzutc())

def test_insufficient_kwargs(self):
with pytest.raises(TypeError):
self.factory.get(year=2016)
Expand Down