-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Determine where TypeError: not all arguments converted during string formatting is occuring? #2489
Comments
This error occurs even with the builtin theme "simple". I opened an issue about this here: #2487 |
Hi'ya @julien-h and @AWegnerGitHub I've been messing around with this for a little bit, but I'm unsure if the error I'm getting is the same as yours. The
If that's the same error then we just need to use the keyword argument
If you don't mind posting what There was some work done to bring the atom/rss feed settings inline with the rest of the settings, #2437, #2383 but I'm guessing there are some bugs still. |
|
I am getting this same error on Travis where I build the website, but the I cannot reproduce the error locally with the same Python and Pelican versions. |
Hi @moorepants, I dug through your config file (assuming this is yours) which brought me to this theme. From the log output I'm assuming it started working on building each category page when it failed. (It was working fine with each tag page, maybe each category was next) So I dug through the theme's repository and found this {% if CATEGORY_FEED_ATOM %}
<link href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_ATOM|format(category.slug) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} {{ category }} Category Atom" />
{% endif %}
{% if CATEGORY_FEED_RSS %}
<link href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_RSS|format(category.slug) }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} {{ category }} Category RSS" />
{% endif %}
{% endblock %} I haven't looked much further yet but I'm guessing it's the same problem. We just need to edit the
Never mind, (my mind is on holiday) sorry. |
Funny, I was pretty sure I disabled that theme on this commit: mechmotum/mechmotum.github.io@866dfc4 and Travis still failed. I can submit a PR to the theme to fix this. Is there a standard setup so that the theme can work with Pelican 3 and 4? Is this a 4.0 backwards incompatibility? |
My travis script also clones from https://github.com/gfidente/pelican-svbhack/ directly on each build, so it should have master. |
the only thing that is making me a little confused it this line in the Travis output git clone --depth=50 --branch=source https://github.com/mechmotum/mechmotum.github.io.git Is Travis cloning the source branch or master when it fails? |
It clones the source branch. It is supposed to. For the doctr tool to work with github pages it has to be on a branch other than master. |
This is docs for doctr that shows why I'm using the source branch: https://drdoctr.github.io/recipes.html#using-doctr-with-github-io-pages |
Hmm, it is supposed to clone the PR branch maybe. |
No, it is working as expected. I think the theme just needs to be updated. |
Haha I came here just to say that, #2437 makes it so we have to update the theme repository to the new ways for the atom/rss feeds |
That's unfortunate. Would be nice if it was backwards compatible and a deprecation warning was raised instead of triggering the TypeError with no useful traceback when themes are using the old API. |
A pull request to that effect would be welcome... 😁
|
Should the themes have something like:
Or do themes not need to work with older versions of pelican? |
@moorepants @bryanbrattlof Had to add in a nest/templates/base.html:
Along with this, had to make a few more edits (not sure if they were neccessary): adding Travis still complains about the |
* The `simple` template that is bundled with Pelican has been shown to suffer from the problem described in getpelican#2489. This has also been reported as a bug in the Debian Bug tracer: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=919636 * This commit fixes the problem by updating the `simple` template to the new way of interpolating variables via the Jinja2 `format` helper function. Signed-off-by: mr.Shu <mr@shu.io>
Go to base.html file, which is usually in templates folder of any theme. Then find '|format(' and replace it with '.format(slug=' without quotes. That should fix the error ''TypeError: not all arguments converted during string formatting." |
- See getpelican/pelican#2489, thanks for the details.
- See getpelican/pelican#2489, thanks for the details. - See Naereen/cuisine@3d7f8acf
Many themes in https://github.com/getpelican/pelican-themes/ are broken, I get this error for 3/4 themes I tried: |
I had this issue even if I don’t call CATEGORY_FEED_ATOM and CATEGORY_FEED_RSS in base.html and I already have 'feeds/{slug}.atom.xml' and 'feeds/{slug}.rss.xml' respectively. Commenting them in the config solved the issue for me. |
So, is there any fix for this? I can’t publish anything on my blog anymore because of this issue. Edit: Nevermind, the fix by mirajpatel19 works as described. |
With Pelican 4.0 there was a change made regarding position argument formatting:
The one that I fixed was
CATEGORY_FEED_ATOM = 'feeds/%s.atom.xml'
toCATEGORY_FEED_ATOM = 'feeds/{slug}.atom.xml'
My problem is that I am still encountering this
TypeError
and I'm not sure where. This is my verbose build output:If I run --print-settings, the only setting with a
%
in it isDEFAULT_DATE_FORMAT
which is unchanged from the default value of'%a %d %B %Y'
set in Pelican's settings.py on line 118How can I determine where or what is causing the TypeError?
The text was updated successfully, but these errors were encountered: