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

subprocess.check_output(["ping", "-c", "3", hostname]) non-zero exit code 2 #126

Closed
yurkomik opened this issue Jun 5, 2013 · 2 comments
Closed

Comments

@yurkomik
Copy link

yurkomik commented Jun 5, 2013

I wrote a method to check internet connection to host site.
simplified version look like this:

def network_check():
hostname = "google.com"
try:
response = subprocess.check_output(["ping", "-c", "3", hostname])
return response
except Exceprion as err:
return err

I run this in threading.Thread

This method works ok in linux and subprocess.check_output(["ping", "-c", "3", "google.com"]) works ok in Qpython console on android but in python-for-android&kivy i get exit code 2 (ping other errors)

I've spent hole evening trying to solve the problem. No results.
Regards, Yurij

@akshayaurora
Copy link
Member

Have you tried --permissions INTERNET, while compiling the apk?

@yurkomik
Copy link
Author

yurkomik commented Jun 6, 2013

Confirming, it works with --permission INTERNET . I thought if there is no internet exitcode is 1 (no reply)
THANKS! :)

@yurkomik yurkomik closed this as completed Jun 6, 2013
renpytom added a commit to renpytom/python-for-android that referenced this issue Oct 6, 2013
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