-
Type: Task
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: pymongocrypt
-
None
We need to apply the same utcnow change from PYTHON-3702 to pymongocrypt:
[2023/07/17 19:56:51.329] =============================== warnings summary =============================== [2023/07/17 19:56:51.329] .venv/lib/python3.12/site-packages/dateutil/tz/tz.py:37 [2023/07/17 19:56:51.329] /data/mci/c3cdcbdfb9b436479082bb1ce97ee100/libmongocrypt/bindings/python/.venv/lib/python3.12/site-packages/dateutil/tz/tz.py:37: DeprecationWarning: datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.fromtimestamp(timestamp, datetime.UTC). [2023/07/17 19:56:51.329] EPOCH = datetime.datetime.utcfromtimestamp(0) [2023/07/17 19:56:51.329] test/test_mongocrypt.py::TestNeedKMSAzureCredentials::test_cache [2023/07/17 19:56:51.329] test/test_mongocrypt.py::TestNeedKMSAzureCredentials::test_cache_expires_soon [2023/07/17 19:56:51.329] test/test_mongocrypt.py::TestNeedKMSAzureCredentials::test_success [2023/07/17 19:56:51.329] /data/mci/c3cdcbdfb9b436479082bb1ce97ee100/libmongocrypt/bindings/python/pymongocrypt/credentials.py:100: DeprecationWarning: datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.now(datetime.UTC). [2023/07/17 19:56:51.329] expiration_time = datetime.utcnow() + timedelta(seconds=expires_in) [2023/07/17 19:56:51.329] test/test_mongocrypt.py::TestNeedKMSAzureCredentials::test_cache_expires_soon [2023/07/17 19:56:51.329] /data/mci/c3cdcbdfb9b436479082bb1ce97ee100/libmongocrypt/bindings/python/pymongocrypt/credentials.py:66: DeprecationWarning: datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.now(datetime.UTC). [2023/07/17 19:56:51.329] if creds.expires_in - datetime.utcnow() < timedelta(seconds=60): [2023/07/17 19:56:51.329] -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
- related to
-
PYTHON-3702 Stop using utcnow and utcfromtimestamp
- Closed