[issue42371] datetime.fromisoformat(): Omitted colon in timezone suffix raises ValueError

2020-11-16 Thread Paul Ganssle


Paul Ganssle  added the comment:

This is the expected behavior of `.fromisoformat()`. A similar issue is 
https://bugs.python.org/issue35829, which asks for the "Z" suffix to be 
supported.

There is a note about this in the documentation: 
https://docs.python.org/3/library/datetime.html#datetime.datetime.fromisoformat

"Caution This does not support parsing arbitrary ISO 8601 strings - it is only 
intended as the inverse operation of datetime.isoformat(). A more full-featured 
ISO 8601 parser, dateutil.parser.isoparse is available in the third-party 
package dateutil."

At some point we will work out the kinks in offering as full an ISO 8601 
datetime parser as possible, but the ISO 8601 datetime spec is very complicated 
and includes many optional features. We deliberately chose to keep the scope of 
`.fromisoformat()` minimal at first, whereas `dateutil.parser.isoparse` 
attempts to be a full-featured ISO8601 parser.

Changing the version affected to 3.10, since this is a feature request.

--
type: behavior -> enhancement
versions: +Python 3.10 -Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42371] datetime.fromisoformat(): Omitted colon in timezone suffix raises ValueError

2020-11-16 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +belopolsky, p-ganssle

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42371] datetime.fromisoformat(): Omitted colon in timezone suffix raises ValueError

2020-11-16 Thread Bengt Lüers

Change by Bengt Lüers :


--
title: datetime.fromisoformat(): Missing colon in timezone suffix raises 
ValueError -> datetime.fromisoformat(): Omitted colon in timezone suffix raises 
ValueError

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com