flask-restx icon indicating copy to clipboard operation
flask-restx copied to clipboard

Fixed failed unit tests caused by using `pytz` inappropriately

Open buttonfly1000 opened this issue 1 year ago • 2 comments

As per the document https://pythonhosted.org/pytz/ :

Unfortunately using the tzinfo argument of the standard datetime constructors 'does not work' with pytz for many timezones.

This fixes https://github.com/python-restx/flask-restx/issues/620

buttonfly1000 avatar Oct 02 '24 05:10 buttonfly1000

Thanks @buttonfly1000

Here is some background on the issue: https://engineering.backmarket.com/moving-forward-in-pythons-time-and-time-zones-aa3ccbd4569a

I think we need to remove pytz and implement zoneinfo. Thos is a 3.9 feature but support for 3.8 is EOL on 31 Oct 2024 so it can be dropped safely.

foarsitter avatar Oct 07 '24 09:10 foarsitter

In https://github.com/python-restx/flask-restx/pull/622 I replaced pytz with stdlib equivalents.

foarsitter avatar Oct 07 '24 11:10 foarsitter

@foarsitter I agree, moving to stdlib is the way to go here.

peter-doggart avatar Nov 11 '24 11:11 peter-doggart