-
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
Unexpected "malformed start tag" error with HTMLParser #715
Comments
We do not make any changes to HTMLParser. You are comparing different Python versions (p4a still uses 2.7.2), which is why the code is different. python/cpython@c10e39f#diff-a07dd7eb9cb779be7f57ea2282a94d96L356 |
@kived I'm sorry, I'm really mortified for that. I'm using buildozer to create the apk and I updated it about a week ago. I thought the packages inside it (including python-for-android) were automatically updated. Please could you tell me if is possible to update the python version to last release without problems? thanks! |
The old python-for-android toolchain doesn't currently support the latest python (actually it supports specifically 2.7.2 and nothing else). It isn't simple to change the version, because the patching necessary to make python build and run on android is version dependent. The new toolchain has experimental support for 3.5 and will be able to use the same method for the latest version of 2.7. It also has a PR to use 2.7.11 when building python itself, but I haven't tested that yet. |
As a workaround, you could include a copy of HTMLParser.py from 2.7.11 in your project itself, and import that instead. Or if you're using other libraries which use HTMLParser then you could monkey-patch it with the updated code. |
Thanks again guys for your tips! |
Used sdl2 toolchain.
traceback:
test program:
html test page:
The problem appears when the parser encounters the non conventional "="" attribute. I add it in this test because some webpage (for reasons that I do not know) insert this syntax in its html page.
I tested it with the desktop version of python and do not raise this issue.
So I went to check the HTMLParser.py files bundled with python-for-android and I compared it with the version found in the standard Python distribution and, discovered that there are some slight differences in the implementation.
The main reason that should generate this error in just one version of the code is located in the
check_for_whole_start_tag ()
method.The troublesome piece of code in python-for-Android is as follows:
instead the piece of code that is replaced in the desktop version is:
Thus if i replace the HTMLParser.py file in the python-for-android with the one founded in linux distribution and then compile the test app with the "new" implementation and deploy it on my smartphone it works great!
Then, as mentioned before, there are some other minor differences in the two distribution that i don't know what they really do, so I ask to developers:
is there any real reason to maintain these differences?
thanks for your support and sorry for my bad english
The text was updated successfully, but these errors were encountered: