Skip to content

Python file is not converted to bytecode when building apk #257

@MohsenHassani

Description

@MohsenHassani

Hello guys,

For using RESTful API, I had to install and use requests package.

So, for building the app, I had to do:
./distribute.sh -m "kivy requests==2.1.0 urllib3"

After making and installing the app, it would not open on my HTC.
Debugging it using adb logcat I noticed an error related to my problem:
SyntaxError: Non-ASCII character '\xa3' in file when function returns...
in the file:
/data/data/a.b.c/files/lib/python2.7/site-packages/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py

Taking a look at the packages within the path, I noticed all files have the extension pyo but this one was in py. I changed the extension to pyo and it solved my problem. The app opened successfully.

So I guess there is a bug or something with the converter for not distributing it in pyo?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions