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

Python3 Branch: jinja2 traceback on buildozer --verbose android debug #322

Closed
FeralBytes opened this issue Feb 2, 2015 · 6 comments
Closed
Labels

Comments

@FeralBytes
Copy link
Contributor

This issue is specific to inclement's Python3 branch of Kivy Py4A.

Traceback (most recent call last):
  File "build.py", line 18, in <module>
    import jinja2
  File "buildlib/jinja2-py3.egg/jinja2/__init__.py", line 33, in <module>
    from jinja2.environment import Environment, Template
  File "buildlib/jinja2-py3.egg/jinja2/environment.py", line 13, in <module>
    from jinja2 import nodes
  File "buildlib/jinja2-py3.egg/jinja2/nodes.py", line 18, in <module>
    from jinja2.utils import Markup
  File "buildlib/jinja2-py3.egg/jinja2/utils.py", line 520, in <module>
    from markupsafe import Markup, escape, soft_unicode
ImportError: No module named 'markupsafe'
@FeralBytes
Copy link
Contributor Author

Fixed by running:

sudo pip3 install markupsafe

Recommend add dependency for install of markupsafe.

@FeralBytes
Copy link
Contributor Author

Next Traceback:

Traceback (most recent call last):
  File "build.py", line 506, in <module>
    make_package(args)
  File "build.py", line 286, in make_package
    manifest_extra=manifest_extra,
  File "build.py", line 72, in render
    text = template.render(**kwargs)
  File "buildlib/jinja2-py3.egg/jinja2/environment.py", line 969, in render
    return self.environment.handle_exception(exc_info, True)
  File "buildlib/jinja2-py3.egg/jinja2/environment.py", line 742, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "buildlib/jinja2-py3.egg/jinja2/_compat.py", line 36, in reraise
    raise value.with_traceback(tb)
  File "templates/AndroidManifest.tmpl.xml", line 14, in <module>
    {% if args.min_sdk_version >= 9 %}
TypeError: unorderable types: str() >= int()

Patch to Fix is:
Line 14 Becomes:

{% if args.min_sdk_version|int >= 9 %}

@FeralBytes
Copy link
Contributor Author

Next Traceback:

Traceback (most recent call last):
  File "build.py", line 506, in <module>
    make_package(args)
  File "build.py", line 286, in make_package
    manifest_extra=manifest_extra,
  File "build.py", line 72, in render
    text = template.render(**kwargs)
  File "buildlib/jinja2-py3.egg/jinja2/environment.py", line 969, in render
    return self.environment.handle_exception(exc_info, True)
  File "buildlib/jinja2-py3.egg/jinja2/environment.py", line 742, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "buildlib/jinja2-py3.egg/jinja2/_compat.py", line 36, in reraise
    raise value.with_traceback(tb)
  File "templates/AndroidManifest.tmpl.xml", line 32, in <module>
    android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|fontScale|uiMode{% if args.min_sdk_version >= 13 %}|screenSize{% endif %}"
TypeError: unorderable types: str() >= int()

Patch to Fix is:
Line 32 Becomes:

android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|fontScale|uiMode{% if args.min_sdk_version|int >= 13 %}|screenSize{% endif %}"

Both of this error and the last are solved by casting the str to int.

@FeralBytes
Copy link
Contributor Author

Fixes committed here: https://github.com/FeralBytes/python-for-android
What is the next step Kivy Developers?
I am now going to test it and see what else arrives. Thanks Inclement for all of your hard work!

@FeralBytes
Copy link
Contributor Author

So, basicly with these changes we can run and execute Python3 code; syntax. But not any new Python 3 features. This was enough for me, that I only had to change 2 lines of code to do things the Python 2 way, but all of my code is written using Python 3 syntax.
This gives us partial support of Python 3.

@tito
Copy link
Member

tito commented Jul 17, 2015

Markupsafe issue has been fixed in master

@tito tito closed this as completed Jul 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants