I have a cron set up to update certbot. It mails a deprecation warning every day. How do I stop the deprecation warning?
Cron <root@ip-99-99-99-99> /root/certbot-auto renew --quiet
/root/.local/share/letsencrypt/lib/python2.6/site-packages/cryptography/__init__.py:26: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of cryptography will drop support for Python 2.6
DeprecationWarning
I tried to file a bug report, but they closed it. https://github.com/certbot/certbot/issues/3984
I tried to install Python2.7 but I can't get certbot to run with Python2.7.
[root@kizbit ~]# scl enable python27 "python --version"
Python 2.7.8
[root@kizbit ~]# scl enable python27 "/root/certbot-auto renew"
/root/.local/share/letsencrypt/lib/python2.6/site-packages/cryptography/__init__.py:26: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of cryptography will drop support for Python 2.6
DeprecationWarning
It still uses Python 2.6 and still produces a warning. I also tried:
[root@kizbit ~]# scl enable python27 "python /root/certbot-auto renew"
File "/root/certbot-auto", line 18
if [ -z "$XDG_DATA_HOME" ]; then
^
SyntaxError: invalid syntax
WITH 2.6 IT WORKS BUT GIVES DEPRECATION:
[root@kizbit ~]# /root/certbot-auto renew
/root/.local/share/letsencrypt/lib/python2.6/site-packages/cryptography/__init__.py:26: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of cryptography will drop support for Python 2.6
DeprecationWarning
Centos 6.8, certbot 0.12.0
Your issue got closed as it is a duplicate from that one, with links to further explanations.
There's no way around it: the Python version available on your system is getting old. Spamming "it is still happening" won't help, a member requested for help already. If that issue matters to your, feel free to contribute a PR.
Otherwise, I wouldn't recommend dropping certbot output to
/dev/null
, ... but if these warnings are really problematic, then you may consider just discarding them.Let's Encrypt community circa 2015 came up with a couple ways to get 2.7, CentOS software collections or third party repositories. Redhat / CentOS 6.x users need python 2.7
It amounts to installing the python27 packages and replacing python2 with python27 in the client. Maybe not strictly necessary since certbot is functional with 2.6, but a good exercise in getting newer software.
Long term you will want to migrate to newer versions of CentOS.
As a dirty, temporary workaround, you can try something like this in your cron entry:
I got Python2.7 installed on CentOS 6 with SCL.
Then you also have to delete
And reinstall something Python 2.7 related (libraries? config?) by just running it plain
Inside the crontab: