-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
--requirements=android gives crash #1504
Comments
@KeyWeeUsr shouldn't (sorry for the wall of text and I'm aware this is not necessarily helping with fixing the issue, I'm just curious) |
@Jonast @KeyWeeUsr The proposed fix has the goal of not breaking anything else. Argument values are hardcoded and are used all over the place, changing the encoding is very likely going to break something somewhere - creating a new issue is not really a fix! Context: As I read it (correctly??), all arguments are parsed as str, and only --requirements values are then cast to utf8. This inconsistency is probably the cause of the issue; and this cast has no utility because does not increase the usable hardcoded character set. These hardcoded strings must be easily available on many keyboard types, must be a lowest common denominator. Allowing utf8 in the hardcoded values creates a potential problem. The world it turns out is not ideal ;) I do think consistency would be a good thing, but changing --requirements to str would also introduces a risk too. |
This project is full of hacks and these hacks tend to pile up and become a nightmare to maintain. Not that I'm opposed to this quick fix, but I personally prefer to understand what is going on, and what (possibly bigger change) will also avoid similar problems in the future. However, this is also most likely a non-issue in Python 3 because that one has a much better string design, so maybe we should just move faster to deprecate Python 2 entirely. |
@Jonast I totally agree about the nightmare. To address that I'd suggest 'str' as the lowest risk path to consistency. Starting from scratch I would perhaps make a different suggestion. Of course whoever actually picks ups the issue gets to choose. |
Thanks for discussing it, I only see that topic now sorry. |
@AndreMiras Thank you. |
Ref #1516. |
Versions
Description
Three command line option issues:
If .p4a contains these two lines:
p4a fails because --bootstrap value is encoded as a str not utf-8
The problem is with encoding of bootstrap string in:
/usr/local/lib/python3.6/dist-packages/pythonforandroid/recipes/android/__init__.py
Assumes the --boostrap option is encoded as 'utf-8', I think all options are 'str'; except the requirements option which is re-coded to 'utf -8'.
A workaround is removing the decode(), this fixes the problem for me
--presplash depends on the 'android' package, though there is no easy way for a user to know this.
But 'android' is not loaded by default.
Enhancement request: Add 'android' to 'requirements' if it is not specified, and --presplash specified
toolchain.py line 268 :
is missing an argument, change to
Command:
.p4a file:
Logs
The text was updated successfully, but these errors were encountered: