Skip to content

Commit b205bd2

Browse files
changes
1 parent 27711ab commit b205bd2

File tree

3 files changed

+6
-19
lines changed

3 files changed

+6
-19
lines changed

Doc/library/datetime.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,12 +1076,13 @@ Other constructors, all class methods:
10761076
ISO 8601 format, with the following exceptions:
10771077

10781078
1. Time zone offsets may have fractional seconds.
1079-
2. Fractional hours and minutes are not supported.
1080-
3. Reduced precision dates are not currently supported (``YYYY-MM``,
1079+
2. The ``T`` separator may be replaced by any single unicode character.
1080+
3. Fractional hours and minutes are not supported.
1081+
4. Reduced precision dates are not currently supported (``YYYY-MM``,
10811082
``YYYY``).
1082-
4. Extended date representations are not currently supported
1083+
5. Extended date representations are not currently supported
10831084
(``±YYYYYY-MM-DD``).
1084-
5. Ordinal dates are not currently supported (``YYYY-OOO``).
1085+
6. Ordinal dates are not currently supported (``YYYY-OOO``).
10851086

10861087
Examples::
10871088

@@ -1110,8 +1111,6 @@ Other constructors, all class methods:
11101111
.. versionchanged:: 3.11
11111112
Previously, this method only supported formats that could be emitted by
11121113
:meth:`date.isoformat` or :meth:`datetime.isoformat`.
1113-
.. versionchanged:: next
1114-
Separators other than ``T`` are deprecated.
11151114

11161115

11171116
.. classmethod:: datetime.fromisocalendar(year, week, day)

Lib/_pydatetime.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1941,11 +1941,6 @@ def fromisoformat(cls, date_string):
19411941
# Split this at the separator
19421942
try:
19431943
separator_location = _find_isoformat_datetime_separator(date_string)
1944-
if separator_location != len(date_string) and date_string[separator_location] != 'T':
1945-
import warnings
1946-
warnings.warn("Support of date/time separators other than "
1947-
"[\"T\"] is deprecated in accordance with ISO "
1948-
"8601:2 and will be removed in 3.15", DeprecationWarning)
19491944
dstr = date_string[0:separator_location]
19501945
tstr = date_string[(separator_location+1):]
19511946

Modules/_datetimemodule.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,8 +1134,7 @@ parse_isoformat_time(const char *dtstr, size_t dtlen, int *hour, int *minute,
11341134
if (tzinfo_pos + 2 < p_end && tzinfo_pos[2] != ':' && strlen(tzinfo_pos) > 2) {
11351135
PyErr_WarnEx(PyExc_DeprecationWarning,
11361136
"Support for partially expanded formats is deprecated in "
1137-
"accordance with ISO 8601:2 and will be removed in 3.15",
1138-
1);
1137+
"accordance with ISO 8601:2 and will be removed in 3.15", 1);
11391138
}
11401139

11411140
rv = parse_hh_mm_ss_ff(tzinfo_pos, p_end, &tzhour, &tzminute, &tzsecond,
@@ -5901,12 +5900,6 @@ datetime_fromisoformat(PyObject *cls, PyObject *dtstr)
59015900
const Py_ssize_t separator_location = _find_isoformat_datetime_separator(
59025901
dt_ptr, len);
59035902

5904-
if (separator_location != -1 && dt_ptr[separator_location] != 'T') {
5905-
PyErr_WarnEx(PyExc_DeprecationWarning,
5906-
"Support of date/time separators other than [\"T\"] is deprecated in "
5907-
"accordance with ISO 8601:2 and will be removed in 3.15", 1);
5908-
}
5909-
59105903
const char *p = dt_ptr;
59115904

59125905
int year = 0, month = 0, day = 0;

0 commit comments

Comments
 (0)