whiskyechobravo / pelican-open_graph

A Pelican plugin to generate Open Graph Protocol tags for your content.
GNU Affero General Public License v3.0
20 stars 8 forks source link

CRITICAL: NameError: name 'instance' is not defined #17

Open antgel opened 5 years ago

antgel commented 5 years ago

As per stack trace below.


Traceback (most recent call last):
  File "/home/antony/.virtualenvs/jewishfalmouth/bin/pelican", line 11, in <module>
    sys.exit(main())
  File "/home/antony/.virtualenvs/jewishfalmouth/lib/python3.6/site-packages/pelican/__init__.py", line 609, in main
    autoreload(watchers, args, old_static, reader_descs)
  File "/home/antony/.virtualenvs/jewishfalmouth/lib/python3.6/site-packages/pelican/__init__.py", line 513, in autoreload
    pelican.run()
  File "/home/antony/.virtualenvs/jewishfalmouth/lib/python3.6/site-packages/pelican/__init__.py", line 184, in run
    signals.all_generators_finalized.send(generators)
  File "/home/antony/.virtualenvs/jewishfalmouth/lib/python3.6/site-packages/blinker/base.py", line 267, in send
    for receiver in self.receivers_for(sender)]
  File "/home/antony/.virtualenvs/jewishfalmouth/lib/python3.6/site-packages/blinker/base.py", line 267, in <listcomp>
    for receiver in self.receivers_for(sender)]
  File "/home/antony/src/git/pelican-plugins/pelican-open_graph/open_graph.py", line 45, in open_graph_tag_articles
    open_graph_tag(page)
  File "/home/antony/src/git/pelican-plugins/pelican-open_graph/open_graph.py", line 59, in open_graph_tag
    soup = BeautifulSoup(instance._content, 'html.parser')
NameError: name 'instance' is not defined```
askpatrickw commented 5 years ago

The bug is that the pelican-plugins repro is linked to this repro at pelican-open_graph @ 83b5499 so the linked version does not work. The Master dos have the fix for this issue in the very next checkin.

I think the repo owners need to change the linked version.

If you need to work around see: https://github.com/whiskyechobravo/pelican-open_graph/commit/2892cbc9203a1e068e58dcbbc8b7840c7e343269#diff-ee3c3cb5c3014fa874d8f4d98615cf96