-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Python Drivers
When running build scripts
./buildscripts/scons.py --variables-files=./etc/scons/mongodbtoolchain_stable_clang.vars --link-model=dynamic --ninja generate-ninja ICECC=icecc CCACHE=ccache BAZEL_FLAGS=--config=local --modules=
we're encountering deprecation warnings from the cryptography library used in pymongo's OCSP support. These warnings suggest updating the use of datetime properties in the ocsp_support.py file.
Specific warnings:
/home/ubuntu/python3-venv/lib/python3.10/site-packages/pymongo/ocsp_support.py:280: CryptographyDeprecationWarning: Properties that return a naïve datetime object have been deprecated. Please switch to this_update_utc. if response.this_update > now: /home/ubuntu/python3-venv/lib/python3.10/site-packages/pymongo/ocsp_support.py:284: CryptographyDeprecationWarning: Properties that return a naïve datetime object have been deprecated. Please switch to next_update_utc. if response.next_update and response.next_update < now: /home/ubuntu/python3-venv/lib/python3.10/site-packages/pymongo/ocsp_cache.py:65: CryptographyDeprecationWarning: Properties that return a naïve datetime object have been deprecated. Please switch to next_update_utc. if value.next_update is None: /home/ubuntu/python3-venv/lib/python3.10/site-packages/pymongo/ocsp_cache.py:71: CryptographyDeprecationWarning: Properties that return a naïve datetime object have been deprecated. Please switch to this_update_utc. value.this_update /home/ubuntu/python3-venv/lib/python3.10/site-packages/pymongo/ocsp_cache.py:73: CryptographyDeprecationWarning: Properties that return a naïve datetime object have been deprecated. Please switch to next_update_utc. < value.next_update /home/ubuntu/python3-venv/lib/python3.10/site-packages/pymongo/ocsp_cache.py:81: CryptographyDeprecationWarning: Properties that return a naïve datetime object have been deprecated. Please switch to next_update_utc. cached_value.next_update is not None /home/ubuntu/python3-venv/lib/python3.10/site-packages/pymongo/ocsp_cache.py:82: CryptographyDeprecationWarning: Properties that return a naïve datetime object have been deprecated. Please switch to next_update_utc. and cached_value.next_update < value.next_update
It appears that the 'this_update' and 'next_update' properties should be replaced with 'this_update_utc' and 'next_update_utc' respectively.
We're using the latest version of pymongo (v4.8.0), and these warnings persist. Could you please update the OCSP support code to use the new API from the cryptography library to resolve these deprecation warnings?
- duplicates
-
PYTHON-4611 cryptography deprecation: Properties that return a naïve datetime object have been deprecated. Please switch to this_update_utc
- Closed