[issue37915] Segfault in comparison between datetime.timezone.utc and pytz.utc

Karthikeyan Singaravelan report at bugs.python.org
Thu Aug 22 08:34:33 EDT 2019


Karthikeyan Singaravelan <tir.karthi at gmail.com> added the comment:

Seems this is due to issue37685 (dde944f9df) on bisecting datetime related changes. Adding Serhiy. I guess this could be marked as release blocker.

Here is a simplified reproducer on extracting pytz.utc source [0] which is an object of simple subclass of datetime.tzinfo : 

import sys
import datetime

print(sys.version)
class UTC(datetime.tzinfo):
    pass

print(datetime.timezone.utc == UTC())
datetime.timezone.utc == datetime.tzinfo() # This also segfaults without a subclass and should be False

# Segfaults

➜  cpython git:(dde944f9df) git checkout dde944f9df && make -s -j4 > /dev/null
HEAD is now at dde944f9df bpo-37685: Fixed comparisons of datetime.timedelta and datetime.timezone. (GH-14996)
➜  cpython git:(dde944f9df) ./python.exe ../backups/bpo37915.py
3.8.0b3+ (tags/v3.8.0b3-30-gdde944f9df:dde944f9df, Aug 22 2019, 17:55:14)
[Clang 7.0.2 (clang-700.1.81)]
[1]    33988 segmentation fault  ./python.exe ../backups/bpo37915.py

# Commit before works fine

➜  cpython git:(dde944f9df) git checkout dde944f9df~1 && make -s -j4 > /dev/null
Previous HEAD position was dde944f9df bpo-37685: Fixed comparisons of datetime.timedelta and datetime.timezone. (GH-14996)
HEAD is now at 4e402d37eb Correct description of HTTP status code 308. (GH-15098)
➜  cpython git:(4e402d37eb) ./python.exe ../backups/bpo37915.py
3.8.0b3+ (tags/v3.8.0b3-30-gdde944f9df:dde944f9df, Aug 22 2019, 17:55:14)
[Clang 7.0.2 (clang-700.1.81)]
False


[0] https://github.com/stub42/pytz/blob/62f872054dde69e5c510094093cd6e221d96d5db/src/pytz/__init__.py#L256

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37915>
_______________________________________


More information about the Python-bugs-list mailing list