master branch of Django REST framework.The newest release Markdown 3.0 break rest_framework
https://pypi.org/project/Markdown/#history
pip install Markdown==3.0
In [1]: from rest_framework import compat
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-1-482462874c04> in <module>()
----> 1 from rest_framework import compat
./venv/lib/python2.7/site-packages/rest_framework/compat.py in <module>()
159 import markdown
160
--> 161 if markdown.version <= '2.2':
162 HEADERID_EXT_PATH = 'headerid'
163 LEVEL_PARAM = 'level'
AttributeError: 'module' object has no attribute 'version'
This is also happening with me. An appropriate attribute is __version__:
Python 3.6.6 (default, Sep 12 2018, 18:26:19)
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import markdown
>>> markdown.version
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'markdown' has no attribute 'version'
>>> markdown.__version__
'3.0'
Eh - this is no fix - "use an old version". Why just don't you check for markdown.__version__, as suggested? Does Markdown 3 break DRF, or does simply DRF use an old attr. BTW,[Markdown resurrected the variable], so this bug could be closed just by waiting on markdown>=3.0.1 or so.
Why don't patch DRF to use __version__?
Why don't patch DRF to use version?
We could, yes. Tho that's not supported until the most recent release - 3.0, so we'd need to do a more careful check ("Use this attribute if it exists, otherwise use that one")
FYI, markdown 3.0.1 with compatibility fix (version) has been released, so, I guess, this ticket can be closed.
https://github.com/Python-Markdown/markdown/commit/6323ba6c98cadc19c0a7eebe9b09279b738dc109
Thanks for the update @zyv!
Most helpful comment
FYI, markdown 3.0.1 with compatibility fix (
version) has been released, so, I guess, this ticket can be closed.https://github.com/Python-Markdown/markdown/commit/6323ba6c98cadc19c0a7eebe9b09279b738dc109