import error with request 2.1.0

81 views
Skip to first unread message

Franck R

unread,
Dec 9, 2013, 6:11:57 AM12/9/13
to python-...@googlegroups.com
All is OK with 2.0.1 and lastest "python for androird" , but with recent release of requests, ihave

I/python  (19485):   File "/data/data/org.MyCompny.widget/files/lib/python2.7/site-packages/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py", line 1
I/python  (19485): SyntaxError: Non-ASCII character '\xf3' in file /data/data/org.MyCompny.widget/files/lib/python2.7/site-packages/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py on line 1, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

i don't see anything if __implementation file.

Franck

Ahmad Farihan

unread,
Feb 20, 2014, 2:01:48 PM2/20/14
to python-...@googlegroups.com
Hi,

I have the same problem. Using Requests with Kivy in ubuntu 12.04 with Python 3.3.3 is ok. But once using Requests in Kivy Android, the exact error came out and Kivy died. Is there any way to choose which version of python to be compiled before uploading to Android other than 2.7.2 ? I tried to mess with distribute.sh file forcing it to change the python version to python 3, but it always download 2.7.2.

Best,

Han

On Monday, December 9, 2013 7:11:57 p.m. UTC +8, Franck R wrote:
All is OK with 2.0.1 and lastest "python for androird" goal with recent release of requests, ihave

I / python (19485): File line 1 I / python (19485): SyntaxError: Non-ASCII character '\ XF3' in file on line 1, but no encoding Declared; see http://www.python.org/peps/ pep-0263.html for details

i do not see anything if __ implementation file.

Franck

Ben Rousch

unread,
Feb 20, 2014, 2:05:54 PM2/20/14
to python-...@googlegroups.com
Python-for-android does not yet support Python 3. It only supports Python 2.7.2.

If you're using buildozer, you can specify an older version of requests like:
requirements = kivy,requests==2.1.0


--
You received this message because you are subscribed to the Google Groups "Python For Android" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-androi...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
 Ben Rousch
   bro...@gmail.com
   http://clusterbleep.net/

Mathieu Virbel

unread,
Sep 8, 2014, 1:23:49 PM9/8/14
to python-...@googlegroups.com
Hi,

I just got the issue on my build.
After analysis, it seems the _implementation.pyo is uncompressed to _implementation.py. And then when python tries to interpret a binary file, it fail.
The name of the full path is: "./lib/python2.7/site-packages/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyo"
The len is exactly 100.

I guess there is a limitation on the filename on the python-for-android lib somewhere, looking at it right now.

Mathieu



Le jeudi 20 février 2014 20:05:54 UTC+1, Ben Rousch a écrit :
Python-for-android does not yet support Python 3. It only supports Python 2.7.2.

If you're using buildozer, you can specify an older version of requests like:
requirements = kivy,requests==2.1.0
On Thu, Feb 20, 2014 at 2:01 PM, Ahmad Farihan <ahmadf...@gmail.com> wrote:
Hi,

I have the same problem. Using Requests with Kivy in ubuntu 12.04 with Python 3.3.3 is ok. But once using Requests in Kivy Android, the exact error came out and Kivy died. Is there any way to choose which version of python to be compiled before uploading to Android other than 2.7.2 ? I tried to mess with distribute.sh file forcing it to change the python version to python 3, but it always download 2.7.2.

Best,

Han

On Monday, December 9, 2013 7:11:57 p.m. UTC +8, Franck R wrote:
All is OK with 2.0.1 and lastest "python for androird" goal with recent release of requests, ihave

I / python (19485): File line 1 I / python (19485): SyntaxError: Non-ASCII character '\ XF3' in file on line 1, but no encoding Declared; see http://www.python.org/peps/ pep-0263.html for details

i do not see anything if __ implementation file.

Franck

--
You received this message because you are subscribed to the Google Groups "Python For Android" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-android+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

Mathieu Virbel

unread,
Sep 9, 2014, 8:08:25 AM9/9/14
to python-...@googlegroups.com
Hi,

I fixed it in the latest python-for-android.
The default format used by tarfile in Python is GNU.
Jtar doesn't know about it, and fail to decompress bigfiles. If you ever see a @LongLink during the decompression, this is a specific file intented to store the full name. By default, the TAR format limit to 100.

So, i changed the default tar format to USTAR.
And updated jtar to a more recent contribution in github, that supports USTAR.

Long filename are now supported.

Enjoy!
Reply all
Reply to author
Forward
0 new messages