arrow icon indicating copy to clipboard operation
arrow copied to clipboard

fix(factory): handle explicit tzinfo=None in arrow.get()

Open armorbreak001 opened this issue 7 months ago • 0 comments

Summary

Fixes #1259.

When tzinfo=None is explicitly passed to arrow.get() (e.g. from a variable that may be None), it was incorrectly treated as 'tzinfo not provided'. This caused the factory to route to the 3-argument constructor path, which fails for calls like arrow.get('2025-01-01', 'YYYY-MM-DD', tzinfo=None) with:

TypeError: Arrow.__init__() missing 1 required positional argument: 'day'

Changes

Use a sentinel object to distinguish between tzinfo being omitted vs explicitly set to None. When explicitly None, the factory now correctly proceeds through the normal (str, format) parsing path instead of being misrouted to the constructor path.

armorbreak001 avatar Apr 22 '26 11:04 armorbreak001