lightalan / subwayclock

Display clock for NYC subways
GNU General Public License v3.0
34 stars 12 forks source link

Error when testing mta.py #11

Open seanykasp opened 2 years ago

seanykasp commented 2 years ago

Im running into an issue when testin ./mta.py

I am receiving the following - are able to help point me in the right direction?

Traceback (most recent call last): File "./mta.py", line 180, in print(getTrainTimes("Q03N","Q03S")) File "./mta.py", line 151, in getTrainTimes times = gettimes(f, ourUptownStation, ourDowntownStation) File "./mta.py", line 72, in gettimes response = requests.get(feed, headers=headers, timeout=30) File "/usr/lib/python3/dist-packages/requests/api.py", line 75, in get return request('get', url, params=params, kwargs) File "/usr/lib/python3/dist-packages/requests/api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request resp = self.send(prep, send_kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send r = adapter.send(request, kwargs) File "/usr/lib/python3/dist-packages/requests/adapters.py", line 449, in send timeout=timeout File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 600, in urlopen chunked=chunked) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 354, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/lib/python3.7/http/client.py", line 1244, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1285, in _send_request self.putheader(hdr, value) File "/usr/lib/python3.7/http/client.py", line 1217, in putheader values[i] = one_value.encode('latin-1') UnicodeEncodeError: 'latin-1' codec can't encode character '\ufeff' in position 0: ordinal not in range(256)

lightalan commented 2 years ago

Check for obvious stuff: Is your API KEY correct? Are you behind a firewall (i.e. can you ping api-endpoint.mta.info)? Try it again...it's possible the MTA API service was down at the time you tried (not likely... but I've seen it before).

On Fri, Dec 3, 2021 at 10:33 PM seanykasp @.***> wrote:

Im running into an issue when testin ./mta.py

I am receiving the following - are able to help point me in the right direction?

Traceback (most recent call last): File "./mta.py", line 180, in print(getTrainTimes("Q03N","Q03S")) File "./mta.py", line 151, in getTrainTimes times = gettimes(f, ourUptownStation, ourDowntownStation) File "./mta.py", line 72, in gettimes response = requests.get(feed, headers=headers, timeout=30) File "/usr/lib/python3/dist-packages/requests/api.py", line 75, in get return request('get', url, params=params, kwargs) File "/usr/lib/python3/dist-packages/requests/api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request resp = self.send(prep, send_kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send r = adapter.send(request, kwargs) File "/usr/lib/python3/dist-packages/requests/adapters.py", line 449, in send timeout=timeout File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 600, in urlopen chunked=chunked) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 354, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/lib/python3.7/http/client.py", line 1244, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1285, in _send_request self.putheader(hdr, value) File "/usr/lib/python3.7/http/client.py", line 1217, in putheader values[i] = one_value.encode('latin-1') UnicodeEncodeError: 'latin-1' codec can't encode character '\ufeff' in position 0: ordinal not in range(256)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lightalan/subwayclock/issues/11, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK7LEU635PIL3CW47FZPCVTUPGDY7ANCNFSM5JLCZ6WQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

seanykasp commented 2 years ago

Hello Alan,

I am a complete noob here. How would I test ping an API endpoint with the pi?

On Sat, Dec 4, 2021 at 9:09 AM Alan Light @.***> wrote:

Check for obvious stuff: Is your API KEY correct? Are you behind a firewall (i.e. can you ping api-endpoint.mta.info)? Try it again...it's possible the MTA API service was down at the time you tried (not likely... but I've seen it before).

On Fri, Dec 3, 2021 at 10:33 PM seanykasp @.***> wrote:

Im running into an issue when testin ./mta.py

I am receiving the following - are able to help point me in the right direction?

Traceback (most recent call last): File "./mta.py", line 180, in print(getTrainTimes("Q03N","Q03S")) File "./mta.py", line 151, in getTrainTimes times = gettimes(f, ourUptownStation, ourDowntownStation) File "./mta.py", line 72, in gettimes response = requests.get(feed, headers=headers, timeout=30) File "/usr/lib/python3/dist-packages/requests/api.py", line 75, in get return request('get', url, params=params, kwargs) File "/usr/lib/python3/dist-packages/requests/api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request resp = self.send(prep, send_kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send r = adapter.send(request, kwargs) File "/usr/lib/python3/dist-packages/requests/adapters.py", line 449, in send timeout=timeout File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 600, in urlopen chunked=chunked) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 354, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/lib/python3.7/http/client.py", line 1244, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1285, in _send_request self.putheader(hdr, value) File "/usr/lib/python3.7/http/client.py", line 1217, in putheader values[i] = one_value.encode('latin-1') UnicodeEncodeError: 'latin-1' codec can't encode character '\ufeff' in position 0: ordinal not in range(256)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lightalan/subwayclock/issues/11, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AK7LEU635PIL3CW47FZPCVTUPGDY7ANCNFSM5JLCZ6WQ

. Triage notifications on the go with GitHub Mobile for iOS < https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android < https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lightalan/subwayclock/issues/11#issuecomment-986033953, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK2G2FR5AASRE53SELJ3XCLUPIOH5ANCNFSM5JLCZ6WQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

lightalan commented 2 years ago

Ahh.. it's pretty EZ

Just type: ping api-endpoint.mta.info

On Tue, Dec 7, 2021, 8:56 PM seanykasp @.***> wrote:

Hello Alan,

I am a complete noob here. How would I test ping an API endpoint with the pi?

On Sat, Dec 4, 2021 at 9:09 AM Alan Light @.***> wrote:

Check for obvious stuff: Is your API KEY correct? Are you behind a firewall (i.e. can you ping api-endpoint.mta.info)? Try it again...it's possible the MTA API service was down at the time you tried (not likely... but I've seen it before).

On Fri, Dec 3, 2021 at 10:33 PM seanykasp @.***> wrote:

Im running into an issue when testin ./mta.py

I am receiving the following - are able to help point me in the right direction?

Traceback (most recent call last): File "./mta.py", line 180, in print(getTrainTimes("Q03N","Q03S")) File "./mta.py", line 151, in getTrainTimes times = gettimes(f, ourUptownStation, ourDowntownStation) File "./mta.py", line 72, in gettimes response = requests.get(feed, headers=headers, timeout=30) File "/usr/lib/python3/dist-packages/requests/api.py", line 75, in get return request('get', url, params=params, kwargs) File "/usr/lib/python3/dist-packages/requests/api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request resp = self.send(prep, send_kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send r = adapter.send(request, kwargs) File "/usr/lib/python3/dist-packages/requests/adapters.py", line 449, in send timeout=timeout File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 600, in urlopen chunked=chunked) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 354, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/lib/python3.7/http/client.py", line 1244, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1285, in _send_request self.putheader(hdr, value) File "/usr/lib/python3.7/http/client.py", line 1217, in putheader values[i] = one_value.encode('latin-1') UnicodeEncodeError: 'latin-1' codec can't encode character '\ufeff' in position 0: ordinal not in range(256)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lightalan/subwayclock/issues/11, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AK7LEU635PIL3CW47FZPCVTUPGDY7ANCNFSM5JLCZ6WQ

. Triage notifications on the go with GitHub Mobile for iOS <

https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android <

https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/lightalan/subwayclock/issues/11#issuecomment-986033953 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AK2G2FR5AASRE53SELJ3XCLUPIOH5ANCNFSM5JLCZ6WQ

. Triage notifications on the go with GitHub Mobile for iOS < https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android < https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/lightalan/subwayclock/issues/11#issuecomment-988424708, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK7LEU77AB7PQZDESAJN3FDUP23MVANCNFSM5JLCZ6WQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

seanykasp commented 2 years ago

I am able to ping the api endpoint.

It doesn't seem like the terminal is properly running the python script.

On Tue, Dec 7, 2021 at 9:09 PM Alan Light @.***> wrote:

Ahh.. it's pretty EZ

Just type: ping api-endpoint.mta.info

On Tue, Dec 7, 2021, 8:56 PM seanykasp @.***> wrote:

Hello Alan,

I am a complete noob here. How would I test ping an API endpoint with the pi?

On Sat, Dec 4, 2021 at 9:09 AM Alan Light @.***> wrote:

Check for obvious stuff: Is your API KEY correct? Are you behind a firewall (i.e. can you ping api-endpoint.mta.info)? Try it again...it's possible the MTA API service was down at the time you tried (not likely... but I've seen it before).

On Fri, Dec 3, 2021 at 10:33 PM seanykasp @.***> wrote:

Im running into an issue when testin ./mta.py

I am receiving the following - are able to help point me in the right direction?

Traceback (most recent call last): File "./mta.py", line 180, in print(getTrainTimes("Q03N","Q03S")) File "./mta.py", line 151, in getTrainTimes times = gettimes(f, ourUptownStation, ourDowntownStation) File "./mta.py", line 72, in gettimes response = requests.get(feed, headers=headers, timeout=30) File "/usr/lib/python3/dist-packages/requests/api.py", line 75, in get return request('get', url, params=params, kwargs) File "/usr/lib/python3/dist-packages/requests/api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request resp = self.send(prep, send_kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send r = adapter.send(request, kwargs) File "/usr/lib/python3/dist-packages/requests/adapters.py", line 449, in send timeout=timeout File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 600, in urlopen chunked=chunked) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 354, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/lib/python3.7/http/client.py", line 1244, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1285, in _send_request self.putheader(hdr, value) File "/usr/lib/python3.7/http/client.py", line 1217, in putheader values[i] = one_value.encode('latin-1') UnicodeEncodeError: 'latin-1' codec can't encode character '\ufeff' in position 0: ordinal not in range(256)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lightalan/subwayclock/issues/11, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AK7LEU635PIL3CW47FZPCVTUPGDY7ANCNFSM5JLCZ6WQ

. Triage notifications on the go with GitHub Mobile for iOS <

https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android <

https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <

https://github.com/lightalan/subwayclock/issues/11#issuecomment-986033953

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AK2G2FR5AASRE53SELJ3XCLUPIOH5ANCNFSM5JLCZ6WQ

. Triage notifications on the go with GitHub Mobile for iOS <

https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android <

https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/lightalan/subwayclock/issues/11#issuecomment-988424708 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AK7LEU77AB7PQZDESAJN3FDUP23MVANCNFSM5JLCZ6WQ

. Triage notifications on the go with GitHub Mobile for iOS < https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android < https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lightalan/subwayclock/issues/11#issuecomment-988430926, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK2G2FV5VRJ5IZJ64GF3I33UP246PANCNFSM5JLCZ6WQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

lightalan commented 2 years ago

Ok, looking more closely at your error output, it looks like you're getting an error with a unicode character FEFF which is "zero-width unbreakable space." Double check there is nothing weird in your apikey, make sure the last character in the apikey is the last character in the file.

On Tue, Dec 7, 2021 at 10:18 PM seanykasp @.***> wrote:

I am able to ping the api endpoint.

It doesn't seem like the terminal is properly running the python script.

On Tue, Dec 7, 2021 at 9:09 PM Alan Light @.***> wrote:

Ahh.. it's pretty EZ

Just type: ping api-endpoint.mta.info

On Tue, Dec 7, 2021, 8:56 PM seanykasp @.***> wrote:

Hello Alan,

I am a complete noob here. How would I test ping an API endpoint with the pi?

On Sat, Dec 4, 2021 at 9:09 AM Alan Light @.***> wrote:

Check for obvious stuff: Is your API KEY correct? Are you behind a firewall (i.e. can you ping api-endpoint.mta.info)? Try it again...it's possible the MTA API service was down at the time you tried (not likely... but I've seen it before).

On Fri, Dec 3, 2021 at 10:33 PM seanykasp @.***> wrote:

Im running into an issue when testin ./mta.py

I am receiving the following - are able to help point me in the right direction?

Traceback (most recent call last): File "./mta.py", line 180, in print(getTrainTimes("Q03N","Q03S")) File "./mta.py", line 151, in getTrainTimes times = gettimes(f, ourUptownStation, ourDowntownStation) File "./mta.py", line 72, in gettimes response = requests.get(feed, headers=headers, timeout=30) File "/usr/lib/python3/dist-packages/requests/api.py", line 75, in get return request('get', url, params=params, kwargs) File "/usr/lib/python3/dist-packages/requests/api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request resp = self.send(prep, send_kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send r = adapter.send(request, kwargs) File "/usr/lib/python3/dist-packages/requests/adapters.py", line 449, in send timeout=timeout File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 600, in urlopen chunked=chunked) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 354, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/lib/python3.7/http/client.py", line 1244, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1285, in _send_request self.putheader(hdr, value) File "/usr/lib/python3.7/http/client.py", line 1217, in putheader values[i] = one_value.encode('latin-1') UnicodeEncodeError: 'latin-1' codec can't encode character '\ufeff' in position 0: ordinal not in range(256)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lightalan/subwayclock/issues/11, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AK7LEU635PIL3CW47FZPCVTUPGDY7ANCNFSM5JLCZ6WQ

. Triage notifications on the go with GitHub Mobile for iOS <

https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android <

https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <

https://github.com/lightalan/subwayclock/issues/11#issuecomment-986033953

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AK2G2FR5AASRE53SELJ3XCLUPIOH5ANCNFSM5JLCZ6WQ

. Triage notifications on the go with GitHub Mobile for iOS <

https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android <

https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub <

https://github.com/lightalan/subwayclock/issues/11#issuecomment-988424708

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AK7LEU77AB7PQZDESAJN3FDUP23MVANCNFSM5JLCZ6WQ

. Triage notifications on the go with GitHub Mobile for iOS <

https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android <

https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/lightalan/subwayclock/issues/11#issuecomment-988430926 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AK2G2FV5VRJ5IZJ64GF3I33UP246PANCNFSM5JLCZ6WQ

. Triage notifications on the go with GitHub Mobile for iOS < https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android < https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/lightalan/subwayclock/issues/11#issuecomment-988460653, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK7LEU5SA334SSUJAKKLD23UP3E7JANCNFSM5JLCZ6WQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

seanykasp commented 2 years ago

So, I think that was it. I couldn’t get the mta.py file to open the apikey.txt file so I just put the apikey directly on mta.py

I’m close. I just need to adjust the sizing.

On Tue, Dec 7, 2021 at 10:49 PM Alan Light @.***> wrote:

Ok, looking more closely at your error output, it looks like you're getting an error with a unicode character FEFF which is "zero-width unbreakable space." Double check there is nothing weird in your apikey, make sure the last character in the apikey is the last character in the file.

On Tue, Dec 7, 2021 at 10:18 PM seanykasp @.***> wrote:

I am able to ping the api endpoint.

It doesn't seem like the terminal is properly running the python script.

On Tue, Dec 7, 2021 at 9:09 PM Alan Light @.***> wrote:

Ahh.. it's pretty EZ

Just type: ping api-endpoint.mta.info

On Tue, Dec 7, 2021, 8:56 PM seanykasp @.***> wrote:

Hello Alan,

I am a complete noob here. How would I test ping an API endpoint with the pi?

On Sat, Dec 4, 2021 at 9:09 AM Alan Light @.***> wrote:

Check for obvious stuff: Is your API KEY correct? Are you behind a firewall (i.e. can you ping api-endpoint.mta.info )? Try it again...it's possible the MTA API service was down at the time you tried (not likely... but I've seen it before).

On Fri, Dec 3, 2021 at 10:33 PM seanykasp @.***> wrote:

Im running into an issue when testin ./mta.py

I am receiving the following - are able to help point me in the right direction?

Traceback (most recent call last): File "./mta.py", line 180, in print(getTrainTimes("Q03N","Q03S")) File "./mta.py", line 151, in getTrainTimes times = gettimes(f, ourUptownStation, ourDowntownStation) File "./mta.py", line 72, in gettimes response = requests.get(feed, headers=headers, timeout=30) File "/usr/lib/python3/dist-packages/requests/api.py", line 75, in get return request('get', url, params=params, kwargs) File "/usr/lib/python3/dist-packages/requests/api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request resp = self.send(prep, send_kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send r = adapter.send(request, kwargs) File "/usr/lib/python3/dist-packages/requests/adapters.py", line 449, in send timeout=timeout File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 600, in urlopen chunked=chunked) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 354, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/lib/python3.7/http/client.py", line 1244, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/lib/python3.7/http/client.py", line 1285, in _send_request self.putheader(hdr, value) File "/usr/lib/python3.7/http/client.py", line 1217, in putheader values[i] = one_value.encode('latin-1') UnicodeEncodeError: 'latin-1' codec can't encode character '\ufeff' in position 0: ordinal not in range(256)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lightalan/subwayclock/issues/11, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AK7LEU635PIL3CW47FZPCVTUPGDY7ANCNFSM5JLCZ6WQ

. Triage notifications on the go with GitHub Mobile for iOS <

https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android <

https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <

https://github.com/lightalan/subwayclock/issues/11#issuecomment-986033953

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AK2G2FR5AASRE53SELJ3XCLUPIOH5ANCNFSM5JLCZ6WQ

. Triage notifications on the go with GitHub Mobile for iOS <

https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android <

https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub <

https://github.com/lightalan/subwayclock/issues/11#issuecomment-988424708

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AK7LEU77AB7PQZDESAJN3FDUP23MVANCNFSM5JLCZ6WQ

. Triage notifications on the go with GitHub Mobile for iOS <

https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android <

https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <

https://github.com/lightalan/subwayclock/issues/11#issuecomment-988430926

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AK2G2FV5VRJ5IZJ64GF3I33UP246PANCNFSM5JLCZ6WQ

. Triage notifications on the go with GitHub Mobile for iOS <

https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android <

https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/lightalan/subwayclock/issues/11#issuecomment-988460653 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AK7LEU5SA334SSUJAKKLD23UP3E7JANCNFSM5JLCZ6WQ

. Triage notifications on the go with GitHub Mobile for iOS < https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android < https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lightalan/subwayclock/issues/11#issuecomment-988473124, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK2G2FTDAIPCB7Q2OFEFPN3UP3IU3ANCNFSM5JLCZ6WQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.