Staging
v0.5.1
https://github.com/python/cpython
Revision 1d4089b5d208ae6f0bd256304fd77f04c0b4fd41 authored by Miss Islington (bot) on 10 June 2018, 22:03:31 UTC, committed by Alexander Belopolsky on 10 June 2018, 22:03:31 UTC
A datetime object d is aware if d.tzinfo is not None and
d.tzinfo.utcoffset(d) does  not return None. If d.tzinfo is None,
or if d.tzinfo is not None but d.tzinfo.utcoffset(d) returns None,
 d is naive.

This commit ensures that instances with non-None d.tzinfo, but
d.tzinfo.utcoffset(d) returning None are treated as naive.

In addition, C acceleration code will raise TypeError if
d.tzinfo.utcoffset(d) returns an object with the type other than
timedelta.

* Updated the documentation.

Assume that the term "naive" is defined elsewhere and remove the
not entirely correct clarification.  Thanks, Tim.
(cherry picked from commit 877b23202b7e7d4f57b58504fd0eb886e8c0b377)

Co-authored-by: Alexander Belopolsky <abalkin@users.noreply.github.com>
1 parent 040d4a7
History
Tip revision: 1d4089b5d208ae6f0bd256304fd77f04c0b4fd41 authored by Miss Islington (bot) on 10 June 2018, 22:03:31 UTC
bpo-33812: Corrected astimezone for naive datetimes. (GH-7578) (GH-7601)
Tip revision: 1d4089b
File Mode Size
clinic
stringlib
README -rw-r--r-- 41 bytes
abstract.c -rw-r--r-- 80.9 KB
accu.c -rw-r--r-- 2.4 KB
boolobject.c -rw-r--r-- 6.5 KB
bytearrayobject.c -rw-r--r-- 69.4 KB
bytes_methods.c -rw-r--r-- 21.0 KB
bytesobject.c -rw-r--r-- 99.6 KB
capsule.c -rw-r--r-- 7.2 KB
cellobject.c -rw-r--r-- 4.8 KB
classobject.c -rw-r--r-- 18.2 KB
codeobject.c -rw-r--r-- 27.6 KB
complexobject.c -rw-r--r-- 31.7 KB
descrobject.c -rw-r--r-- 53.7 KB
dict-common.h -rw-r--r-- 2.3 KB
dictnotes.txt -rw-r--r-- 6.0 KB
dictobject.c -rw-r--r-- 132.0 KB
enumobject.c -rw-r--r-- 13.1 KB
exceptions.c -rw-r--r-- 85.9 KB
fileobject.c -rw-r--r-- 15.2 KB
floatobject.c -rw-r--r-- 70.7 KB
frameobject.c -rw-r--r-- 33.8 KB
funcobject.c -rw-r--r-- 30.1 KB
genobject.c -rw-r--r-- 67.7 KB
iterobject.c -rw-r--r-- 8.9 KB
listobject.c -rw-r--r-- 86.0 KB
listsort.txt -rw-r--r-- 34.9 KB
lnotab_notes.txt -rw-r--r-- 5.7 KB
longobject.c -rw-r--r-- 167.5 KB
memoryobject.c -rw-r--r-- 88.6 KB
methodobject.c -rw-r--r-- 15.5 KB
moduleobject.c -rw-r--r-- 22.6 KB
namespaceobject.c -rw-r--r-- 7.4 KB
object.c -rw-r--r-- 56.8 KB
obmalloc.c -rw-r--r-- 79.1 KB
odictobject.c -rw-r--r-- 76.7 KB
rangeobject.c -rw-r--r-- 37.1 KB
setobject.c -rw-r--r-- 73.1 KB
sliceobject.c -rw-r--r-- 19.2 KB
structseq.c -rw-r--r-- 12.9 KB
tupleobject.c -rw-r--r-- 29.9 KB
typeobject.c -rw-r--r-- 232.5 KB
typeslots.inc -rw-r--r-- 3.9 KB
typeslots.py -rwxr-xr-x 1.2 KB
unicodectype.c -rw-r--r-- 7.5 KB
unicodeobject.c -rw-r--r-- 455.4 KB
unicodetype_db.h -rw-r--r-- 234.1 KB
weakrefobject.c -rw-r--r-- 29.5 KB

README

back to top