Skip to content

Commit

Permalink
Treat "Z" offset in datetime as case-insensitive (#435)
Browse files Browse the repository at this point in the history
This should be case-insensitive; e.g. this test failed:

	% toml-test ./tests/decoding_test.py -run valid/datetime/datetime
	FAIL valid/datetime/datetime
	     Key "lower" is not "datetime" but "datetime-local":
	       Expected:     map[string]any{"type":"datetime", "value":"1987-07-05T17:45:00Z"}
	       Your encoder: map[string]any{"type":"datetime-local", "value":"1987-07-05T17:45:00"}
  • Loading branch information
arp242 committed Oct 11, 2023
1 parent 6d51c0a commit 65bab75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion toml/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ def _load_date(val):
microsecond = int(int(subsecondval) *
(10 ** (6 - len(subsecondval))))
else:
tz = TomlTz(val[19:])
tz = TomlTz(val[19:].upper())
except ValueError:
tz = None
if "-" not in val[1:]:
Expand Down

0 comments on commit 65bab75

Please sign in to comment.