Python Forum
Could not parse the remainder: '=' from '=' - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Could not parse the remainder: '=' from '=' (/thread-16255.html)



Could not parse the remainder: '=' from '=' - Saurabh - Feb-20-2019

I am upgrading from python 2 to 3 .



{% if category = 'media-articles' %}
Could not parse the remainder: '=' from '='


This strange issue has come up anew.
Please note that this code was working fine with python2.7

I have tried all the said solutions of extra space around the operator.
Kindly help me solve this issue and if required apply a fix in python3 as well.

This issue is found in python3.5 and python3.6 environments.


RE: Could not parse the remainder: '=' from '=' - buran - Feb-20-2019

Shouldn't it be
Output:
{% if category == 'media-articles' %}
I don't think your original code would work in python2 either


RE: Could not parse the remainder: '=' from '=' - Saurabh - Feb-20-2019

(Feb-20-2019, 10:21 AM)buran Wrote: Shouldn't it be
Output:
{% if category == 'media-articles' %}
I don't think your original code would work in python2 either
In the initial code it was = , but yes you are right. Logically it should be ==.

Although the sadder part is , I've tried all possibilities including this and it's giving the same exact error.


RE: Could not parse the remainder: '=' from '=' - buran - Feb-20-2019

(Feb-20-2019, 11:15 AM)Saurabh Wrote: Although the sadder part is , I've tried all possibilities including this and it's giving the same exact error.


Please post full traceback in error tags, as well as the relevant code that render the template - in python tags