Fail to Deploy on Netlify with Pelican 4.5.0

Netlify Defualt Python is 2.7!!

I tried to deploy my zh site yesterday but I did not make it because of python collection.abc import error raised by python 2.7:

4:07:18 PM: $ make html
4:07:18 PM: pelican /opt/build/repo/content -o /opt/build/repo/output -s /opt/build/repo/pelicanconf.py
4:07:18 PM: Traceback (most recent call last):
4:07:18 PM:   File "/opt/buildhome/python2.7/bin/pelican", line 5, in <module>
4:07:18 PM:     from pelican.__main__ import main
4:07:18 PM:   File "/opt/buildhome/python2.7/local/lib/python2.7/site-packages/pelican/__init__.py", line 9, in <module>
4:07:18 PM:     from collections.abc import Iterable
4:07:18 PM: ImportError: No module named abc
4:07:18 PM: Makefile:41: recipe for target 'html' failed
4:07:18 PM: make: *** [html] Error 1

This surprised me very much because 1) the default python version is 2.7, which has been EOL. 2) I did not believe pelican did not use collection.abc in the previous version. So I dived into my last successful deployment and knew I used pelican 4.2.0, and the current failure is running with 4.5.0. After bisecting the issue, I compare the code snippet:

# pelican 4.5.0  pelican/__init__.py
......
from collections.abc import Iterable
......
# pelican 4.2.0  pelican/__init__.py
......
try:
    import collections.abc as collections
except ImportError:
    import collections
......

Here we get the root cause! I suppose there is some more context about deprecating the compatibility. We may have a look next time! : )