omz / Pythonista-Issues

Issue tracker for Pythonista (iOS)
169 stars 14 forks source link

Requests issue on mobile network #566

Open b-j-m opened 6 years ago

b-j-m commented 6 years ago

I’m using the requests library to get text from google docs. The request works perfectly on WiFi and on LTE using Verizon or AT&T. But on T-Mobile LTE I get a connection error. System info is below. The same code works perfectly on Pythonista 3 on all networks, so there is clearly some buggy interaction here between T-mobile and pythonista 2. (It does work via a VPN on T-Mobile which is my current workaround.)

The code is simple: import requests site = 'https://docs.google.com/spreadsheets/d/(removed for privacy)/gviz/tq?tqx=out:csv&sheet=Sheet1&range=A1:D52' a=requests.get(site,timeout=10) print(a.text)

I am using pythonista 2 because this code is part of an app I’ve made within Xcode and I need the code available as an app.

Any ideas? I suspect it’s the version of the library in pythonista 2 vs 3. Is there a way to update the library or else switch the Xcode project to python 3?

System Information

cclauss commented 6 years ago

Did you try increasing timeout=10?

b-j-m commented 6 years ago

Yes, that is the value that I've been using in my production code.

On Mon, Sep 10, 2018 at 12:34 AM cclauss notifications@github.com wrote:

Did you try increasing timeout=10?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/omz/Pythonista-Issues/issues/566#issuecomment-419784684, or mute the thread https://github.com/notifications/unsubscribe-auth/Al0YD5Sd_RM22NfRckm6GTIfD34jkrgxks5uZevigaJpZM4WgY_e .

cclauss commented 6 years ago

When you increase it to 60, do things start to work on not?

b-j-m commented 6 years ago

Tried 60without success. A timeout of 10 does work in v3, just not v2

b-j-m commented 6 years ago

No making it 60 does not fix it either

On Mon, Sep 10, 2018 at 3:11 PM cclauss notifications@github.com wrote:

When you increase it to 60, do things start to work on not?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/omz/Pythonista-Issues/issues/566#issuecomment-420026798, or mute the thread https://github.com/notifications/unsubscribe-auth/Al0YD66MIypoGXiwQqGs7qpGvy_3aQx-ks5uZrltgaJpZM4WgY_e .

dgelessus commented 6 years ago

This is probably related to #344.

I don't think there's much that can be done about this until @omz updates the app template to Python(ista) 3, since the issue is fixed in the current Pythonista 3 version (as you already noticed).