Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with new version of pelican: 'Pelican' object has no attribute 'get_writer' #9

Open
trevorld opened this issue Feb 10, 2021 · 3 comments

Comments

@trevorld
Copy link

I'm not sure if bug reports should go here or https://github.com/getpelican/pelican-plugins/issues . The "pelican_comment_system" seems to no longer work for me with the latest version of pelican. Instead I get a "'Pelican' object has no attribute 'get_writer'" error:

pelican -o output -s pelicanconf.py content --debug
DEBUG: Pelican version: 4.5.4
DEBUG: Python version: 3.8.5
DEBUG: Adding current directory to system path
DEBUG: Finding namespace plugins
DEBUG: Loading plugin `pelican_comment_system`
DEBUG: Registering plugin `pelican_comment_system`
DEBUG: Found generator: ArticlesGenerator (internal)
DEBUG: Found generator: PagesGenerator (internal)
DEBUG: Found generator: StaticGenerator (internal)
DEBUG: Template list: ['!simple/archives.html', '!simple/article.html', '!simple/author.html', '!simple/authors.html', '!simple/base.html', '!simple/categories.html', '!simple/category.html', '!simple/gosquared.html', '!simple/index.html', '!simple/page.html', '!simple/pagination.html', '!simple/period_archives.html', '!simple/tag.html', '!simple/tags.html', '!simple/translations.html', '!theme/analytics.html', '!theme/archives.html', '!theme/article.html', '!theme/article_infos.html', '!theme/author.html', '!theme/authors.html', '!theme/base.html', '!theme/category.html', '!theme/comments.html', '!theme/disqus_script.html', '!theme/github.html', '!theme/index.html', '!theme/page.html', '!theme/pcs/comments.html', '!theme/period_archives.html', '!theme/tag.html', '!theme/taglist.html', '!theme/tags.html', '!theme/translations.html', '!theme/twitter.html', 'analytics.html', 'archives.html', 'article.html', 'article_infos.html', 'author.html', 'authors.html', 'base.html', 'categories.html', 'category.html', 'comments.html', 'disqus_script.html', 'github.html', 'gosquared.html', 'index.html', 'page.html', 'pagination.html', 'pcs/comments.html', 'period_archives.html', 'tag.html', 'taglist.html', 'tags.html', 'translations.html', 'twitter.html']
CRITICAL: 'Pelican' object has no attribute 'get_writer'
Traceback (most recent call last):
  File "/home/trevor/.local/bin/pelican", line 8, in <module>
    sys.exit(main())
  File "/home/trevor/.local/lib/python3.8/site-packages/pelican/__init__.py", line 527, in main
    pelican.run()
  File "/home/trevor/.local/lib/python3.8/site-packages/pelican/__init__.py", line 93, in run
    generators = [
  File "/home/trevor/.local/lib/python3.8/site-packages/pelican/__init__.py", line 94, in <listcomp>
    cls(
  File "/home/trevor/.local/lib/python3.8/site-packages/pelican/generators.py", line 298, in __init__
    signals.article_generator_init.send(self)
  File "/usr/lib/python3/dist-packages/blinker/base.py", line 266, in send
    return [(receiver, receiver(sender, **kwargs))
  File "/usr/lib/python3/dist-packages/blinker/base.py", line 266, in <listcomp>
    return [(receiver, receiver(sender, **kwargs))
  File "/home/trevor/.local/lib/python3.8/site-packages/pelican_comment_system/__init__.py", line 89, in initialize
    _pelican_writer = _pelican_obj.get_writer()
AttributeError: 'Pelican' object has no attribute 'get_writer'
@mpaglia0
Copy link

Same issue here!

@LecygneNoir
Copy link

Hello,

I had the same issue, tested a little around, and find that since some Pelican versions (commit), get_writer is simply renamed _get_writer 😅

So you may patch line 89 of pelican_comment_system to add a _, and tadaaa

Hope it helps!

As unfortunately the project seems dead at the moment, I am unsure if a pull request is necessary, but Bernhard if you come around do not hesitate to ping me 😘

While I am on it, thannnnnks a lot for this project, it's still very useful 4 years after the last commit!

@mpaglia0
Copy link

Thank you indeed! Nevertheless since this plugin requires also another javascript, I am hacking Static Comments in order to have a simple form but keep the plugin very simple and fast.

minchinweb added a commit to minchinweb/minchin.pelican.plugins.static_comments that referenced this issue May 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants