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

ValueError: not enough values to unpack (expected 3, got 1) #16

Open
mistzy0321 opened this issue May 11, 2021 · 1 comment
Open

ValueError: not enough values to unpack (expected 3, got 1) #16

mistzy0321 opened this issue May 11, 2021 · 1 comment

Comments

@mistzy0321
Copy link

Relatively dumb when it comes to coding. Tried specifying one SAMECODE, got that. Specified 2, got the same results. Same happened when I tried to use a state. Omitting most of the unnecessary code to save 180 or so lines.

import weatheralerts
from weatheralerts import WeatherAlerts

nws = WeatherAlerts(samecodes='022055') #not my SAMECODE, random one I planned on using to test as it had a flash flood warning in effect
for alert in nws.alerts:
     print(f"{alert.areadesc}: {alert.title}")

Originally was writing to a file as well, but shouldn't make a difference here whether or not I change it to a print string.

@ghost
Copy link

ghost commented Jul 4, 2021

Same issue here:

>>> from weatheralerts import WeatherAlerts
>>> nws = WeatherAlerts(samecodes='012057')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/homebrew/lib/python3.9/site-packages/weatheralerts/weather_alerts.py", line 27, in __init__
    self.geo = GeoDB()
  File "/opt/homebrew/lib/python3.9/site-packages/weatheralerts/geo.py", line 17, in __init__
    self.__same = SameCodes()
  File "/opt/homebrew/lib/python3.9/site-packages/weatheralerts/geo.py", line 95, in __init__
    self._load_same_codes()
  File "/opt/homebrew/lib/python3.9/site-packages/weatheralerts/geo.py", line 111, in _load_same_codes
    self._cached_same_codes()
  File "/opt/homebrew/lib/python3.9/site-packages/weatheralerts/geo.py", line 148, in _cached_same_codes
    self.reload()
  File "/opt/homebrew/lib/python3.9/site-packages/weatheralerts/geo.py", line 104, in reload
    self._load_same_codes(refresh=True)
  File "/opt/homebrew/lib/python3.9/site-packages/weatheralerts/geo.py", line 109, in _load_same_codes
    self._get_same_codes()
  File "/opt/homebrew/lib/python3.9/site-packages/weatheralerts/geo.py", line 121, in _get_same_codes
    code, local, state = str(row).strip().split(',')
ValueError: not enough values to unpack (expected 3, got 1)

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

1 participant