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

parse.py: Unicode vs. str for Python 2 #11

Open
CLiu13 opened this issue Jan 24, 2019 · 0 comments
Open

parse.py: Unicode vs. str for Python 2 #11

CLiu13 opened this issue Jan 24, 2019 · 0 comments

Comments

@CLiu13
Copy link
Contributor

CLiu13 commented Jan 24, 2019

When running slimish-jinja via Python 2, I got this error:

 File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/slimish_jinja/slimish_jinja.py", line 34, in preprocess
    Parser(lexer, callback=output.write, debug=self.environment.slim_debug).parse()
  File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/slimish_jinja/parse.py", line 35, in parse
    self.callback(self.format_output(self.lookahead))
TypeError: unicode argument expected, got 'str'

I believe that this could be fixed by surrounding the return on parse.py:206 and parse.py:208 with unicode() (only when Python 2, since that method does not exist in Python 3), but I have not verified this yet.

@thoughtnirvana thoughtnirvana deleted a comment from deepalikumar Jan 31, 2019
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

1 participant