[Python-apps-team] Bug#919636: pelican: "make publish" with Atom feed yields "CRITICAL: TypeError: not all arguments converted during string formatting"
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Fri Jan 18 06:09:57 GMT 2019
Package: pelican
Version: 4.0.1+dfsg-1
Severity: normal
With a simple pelican installation with Atom category feeds enabled,
running "make publish" yields:
0 dkg at alice:/tmp/cdtemp.afhJme$ make publish
pelican /tmp/cdtemp.afhJme/content -o /tmp/cdtemp.afhJme/output -s /tmp/cdtemp.afhJme/publishconf.py
CRITICAL: TypeError: not all arguments converted during string formatting
make: *** [Makefile:77: publish] Error 1
2 dkg at alice:/tmp/cdtemp.afhJme$
As a workaround, i can bypass this error either by removing this line
from publishconf.py:
CATEGORY_FEED_ATOM = 'feeds/{slug}.atom.xml'
or by changing "CATEGORY_FEED_ATOM|format(category.slug)" to either
"CATEGORY_FEED_ATOM" or "category.slug" in
/usr/lib/python3/dist-packages/pelican/themes/simple/templates/base.html
so the problem has something to do with that jinja format string, but
i don't understand pelican's use of jinja well enough to pinpoint
it. Maybe it's just that jinja isn't processing the |format(xxx)
filter for some reason?
Below is the output of "make DEBUG=1 publish" showing the jinja
traceback to the error:
0 dkg at alice:/tmp/cdtemp.afhJme$ make DEBUG=1 publish
pelican /tmp/cdtemp.afhJme/content -o /tmp/cdtemp.afhJme/output -s /tmp/cdtemp.afhJme/publishconf.py -D
DEBUG: Pelican version: 4.0.1
DEBUG: Python version: 3.7.2
DEBUG: Temporarily adding PLUGIN_PATHS to system path
DEBUG: Restoring system path
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/archives.html', '!theme/article.html', '!theme/author.html', '!theme/authors.html', '!theme/base.html', '!theme/categories.html', '!theme/category.html', '!theme/gosquared.html', '!theme/index.html', '!theme/page.html', '!theme/pagination.html', '!theme/period_archives.html', '!theme/tag.html', '!theme/tags.html', '!theme/translations.html', 'archives.html', 'article.html', 'author.html', 'authors.html', 'base.html', 'categories.html', 'category.html', 'gosquared.html', 'index.html', 'page.html', 'pagination.html', 'period_archives.html', 'tag.html', 'tags.html', 'translations.html']
DEBUG: Deleted directory /tmp/cdtemp.afhJme/output/feeds
DEBUG: Read file test.md -> Article
DEBUG: Signal article_generator_preread.send(ArticlesGenerator)
DEBUG: Successfuly imported extension module "markdown.extensions.codehilite".
DEBUG: Successfully loaded extension "markdown.extensions.codehilite.CodeHiliteExtension".
DEBUG: Successfuly imported extension module "markdown.extensions.extra".
DEBUG: Successfully loaded extension "markdown.extensions.fenced_code.FencedCodeExtension".
DEBUG: Successfully loaded extension "markdown.extensions.footnotes.FootnoteExtension".
DEBUG: Successfully loaded extension "markdown.extensions.attr_list.AttrListExtension".
DEBUG: Successfully loaded extension "markdown.extensions.def_list.DefListExtension".
DEBUG: Successfully loaded extension "markdown.extensions.tables.TableExtension".
DEBUG: Successfully loaded extension "markdown.extensions.abbr.AbbrExtension".
DEBUG: Successfully loaded extension "markdown.extensions.extra.ExtraExtension".
DEBUG: Successfuly imported extension module "markdown.extensions.meta".
DEBUG: Successfully loaded extension "markdown.extensions.meta.MetaExtension".
DEBUG: Signal article_generator_context.send(ArticlesGenerator, <metadata>)
-> Writing /tmp/cdtemp.afhJme/output/feeds/all.atom.xml
-> Writing /tmp/cdtemp.afhJme/output/feeds/misc.atom.xml
CRITICAL: TypeError: not all arguments converted during string formatting
Traceback (most recent call last):
File "/usr/bin/pelican", line 11, in <module>
load_entry_point('pelican==4.0.1', 'console_scripts', 'pelican')()
File "/usr/lib/python3/dist-packages/pelican/__init__.py", line 623, in main
pelican.run()
File "/usr/lib/python3/dist-packages/pelican/__init__.py", line 190, in run
p.generate_output(writer)
File "/usr/lib/python3/dist-packages/pelican/generators.py", line 689, in generate_output
self.generate_pages(writer)
File "/usr/lib/python3/dist-packages/pelican/generators.py", line 598, in generate_pages
self.generate_articles(write)
File "/usr/lib/python3/dist-packages/pelican/generators.py", line 470, in generate_articles
url=article.url, blog=True)
File "/usr/lib/python3/dist-packages/pelican/writers.py", line 254, in write_file
override_output)
File "/usr/lib/python3/dist-packages/pelican/writers.py", line 186, in _write_file
output = template.render(localcontext)
File "/usr/lib/python3/dist-packages/jinja2/asyncsupport.py", line 76, in render
return original_render(self, *args, **kwargs)
File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1008, in render
return self.environment.handle_exception(exc_info, True)
File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python3/dist-packages/jinja2/_compat.py", line 37, in reraise
raise value.with_traceback(tb)
File "/usr/lib/python3/dist-packages/pelican/themes/simple/templates/article.html", line 1, in top-level template code
{% extends "base.html" %}
File "/usr/lib/python3/dist-packages/pelican/themes/simple/templates/base.html", line 4, in top-level template code
{% block head %}
File "/usr/lib/python3/dist-packages/pelican/themes/simple/templates/article.html", line 7, in block "head"
{{ super() }}
File "/usr/lib/python3/dist-packages/pelican/themes/simple/templates/base.html", line 20, in block "head"
<link href="{{ FEED_DOMAIN }}/{% if CATEGORY_FEED_ATOM_URL %}{{ CATEGORY_FEED_ATOM_URL|format(category.slug) }}{% else %}{{ CATEGORY_FEED_ATOM|format(category.slug) }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Categories Atom Feed" />
File "/usr/lib/python3/dist-packages/jinja2/filters.py", line 685, in do_format
return soft_unicode(value) % (kwargs or args)
TypeError: not all arguments converted during string formatting
make: *** [Makefile:77: publish] Error 1
2 dkg at alice:/tmp/cdtemp.afhJme$
Thanks for maintaining pelican in debian!
--dkg
-- System Information:
Debian Release: buster/sid
APT prefers testing-debug
APT policy: (500, 'testing-debug'), (500, 'testing'), (200, 'unstable-debug'), (200, 'unstable'), (1, 'experimental-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.19.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages pelican depends on:
ii python3 3.7.1-3
ii python3-blinker 1.4+dfsg1-0.2
ii python3-dateutil 2.6.1-1
ii python3-docutils 0.14+dfsg-3
ii python3-feedgenerator 1.9-1
ii python3-jinja2 2.10-1
ii python3-markdown 3.0.1-2
ii python3-pkg-resources 40.6.2-1
ii python3-pygments 2.2.0+dfsg-2
ii python3-six 1.12.0-1
ii python3-tz 2018.9-1
ii python3-unidecode 1.0.23-1
pelican recommends no packages.
Versions of packages pelican suggests:
ii pandoc 2.2.1-3+b2
ii pelican-doc 4.0.1+dfsg-1
pn python3-bs4 <none>
-- no debconf information
More information about the Python-apps-team
mailing list