Skip to content

fix issue #114#117

Open
JaiRaj22 wants to merge 1 commit intodonnemartin:masterfrom
JaiRaj22:issue-114
Open

fix issue #114#117
JaiRaj22 wants to merge 1 commit intodonnemartin:masterfrom
JaiRaj22:issue-114

Conversation

@JaiRaj22
Copy link
Copy Markdown

@JaiRaj22 JaiRaj22 commented Mar 9, 2026

Fix inconsistent error handling in clean_date_time_zone
Moved all parsing logic (string slicing + strptime) inside the try block so malformed input is always caught
Added an except (ValueError, IndexError) clause that re-raises as a descriptive ValueError, making the failure mode explicit and caller-friendly
Removed the dead date_time = None / time_zone_parsed = None initialisations that existed only to support the now-removed implicit None return
Updated the docstring to accurately reflect the contract: returns a 3-tuple on success, raises ValueError on failure

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.

2 participants