Skip to content
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

pip: configargparse: 'ascii' codec can't decode byte 0x80...: ordinal not in range(128) #157

Open
kaiof opened this issue Feb 15, 2017 · 1 comment

Comments

@kaiof
Copy link

kaiof commented Feb 15, 2017

QPython 1.0.0 / Python 3.2.2 - no later version in Play store; couldn't find 1.2.3.

The error in the title (reporting an "invalid header") occurs when attempting to "pip install mitmproxy"

It's coming from nti() in tarfile.py, which has a bug for packages coming from Windows systems (or anywhere the uid/gid aren't set):

https://bugs.python.org/issue24514
https://bugs.python.org/msg245844
https://bugs.python.org/file39815/issue24514.diff

It's resolved by adding rstrip() at line 178, so I patched but that wasn't it:

- n = int(nts(s, "ascii", "strict") or "0", 8) 
+ n = int(nts(s, "ascii", "strict").rstrip() or "0", 8)

...though it seems like that change should probably be there. So I found another potential cause:

PyMySQL/PyMySQL#176
PyMySQL/PyMySQL#207 (comment)

This might be fixed (second link says 3.3 was the first version to support unicode strings) by setting the file encoding (utf-8) marker on every file and removing 'u' from strings (but I'm not familiar enough to intercept this during pip) or possibly by importing 'future' (first link) and adding unicode support:

from future import unicode_literals

but the 'future' module is not provided in QPython3.

'mitmproxy' is ridiculously useful when developing apps on an Android phone. Is there any way the underlying Python version can be bumped up (or since you know your app better, somehow fix this?)

@rvilla87
Copy link

rvilla87 commented Aug 15, 2017

I'm interested also in installing mitmproxy in android, did you do it finally? I also have the same error with 1.0.3 release.

I tried 1.3.0 beta 2 release that uses Python 3.6 but I have 2 new errors (depending which library I try to install):
ImportError: No module named _ctypes
operation not permitted

With 1.0.3 I can import ctypes but I can't do it with 1.3.0 beta 2 version.

Hope in next version they fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants