-
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
open() build-in function don't work as expected #706
Comments
This is not an issue with python-for-android. Line endings: different platforms write different line endings. You have to take steps to deal with this, just like you would in any other Python program. A common fix is to use universal newlines ('U' flag to Copyright symbol: this is an encoding issue. ASCII does not have a copyright symbol (that's extended ASCII, which is not what we're talking about). You should decode the text yourself, since Python will assume ASCII. For example, if the file is in UTF-8, you can do something like |
The decode doesn't work. I've checked this link Anyhow this doesn't solve the compatibily break. On other platforms, this is not necessary. I tested it and work properly (at least for me). Please, @kived reopen this post and give a try yourself or at least tell me where is the right section for open a new issue for that kind of problem. thanks again for you work. |
The reason I closed this is that your issue has nothing to do with python-for-android. This is the same for any Python application. And using https://gist.github.com/kived/b72eae147581d58a4f66c8c11a973e29 |
Hello,
first of all sorry for my bad english, i do not use it often.
Said that, i found the following two possible bugs:
The first concerns the carriage return that on Android is recognizes only the LF and then when meets the other 2 types it give trouble.
So in practice, if you want to create a file directly from Android or on a Linux machine should be no problem, but when you create the file with an OS that uses another kind of carriage return and then transferred to Android system then you will have that problem.
The second problem concerns the special characters as, for example, the "copyright" © which returns the following error traceback:
This problem may be related to this type of implementation of the code http://stackoverflow.com/a/5245904, but in this case the workarounds proposed do not solve (at least in my opinion) the compatibily problems.
Both of the above problems occur only in the Android platform, which instead in others Python implementation that i have tested (windows/linux) are all easily managed.
I used buildozer toolkit to build the following test code:
main.py
opentest.py
page.html
It would be great if you could solve it in the upcoming milestone or at least in the dev branch.
thanks
The text was updated successfully, but these errors were encountered: