Skip to content

Commit

Permalink
Allow lower case "t" and "z" in datetimes (#149)
Browse files Browse the repository at this point in the history
* Allow lower case "t" and "z" in datetimes

https://datatracker.ietf.org/doc/html/rfc3339#section-5.6

* Add changelog entry

Co-authored-by: Taneli Hukkinen <3275109+hukkin@users.noreply.github.com>
  • Loading branch information
oittaa and hukkin committed Dec 8, 2021
1 parent 77dce70 commit e4f44e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,8 @@
- Python 3.6 support
- Support for text file objects as `load` input. Use binary file objects instead.
- First argument of `load` and `loads` can no longer be passed by keyword.
- Fixed
- Allow lower case "t" and "z" in datetimes
- Improved
- Raise an error when dotted keys define values outside the "current table".
Technically speaking TOML v1.0.0 does allow such assignments
Expand Down
4 changes: 2 additions & 2 deletions tomli/_re.py
Expand Up @@ -36,9 +36,9 @@
fr"""
([0-9]{{4}})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]) # date, e.g. 1988-10-27
(?:
[T ]
[Tt ]
{_TIME_RE_STR}
(?:(Z)|([+-])([01][0-9]|2[0-3]):([0-5][0-9]))? # optional time offset
(?:([Zz])|([+-])([01][0-9]|2[0-3]):([0-5][0-9]))? # optional time offset
)?
""",
flags=re.VERBOSE,
Expand Down

0 comments on commit e4f44e3

Please sign in to comment.