Just calling League(league_id=league_id, year=curr_season, espn_s2=espn_s2, swid=espn_swid) gives an error KeyError: 'location'. I'm guessing this is an issue with ESPN, as now the issue stems from this part of the League class.
self.team_name = "%s %s" % (data['location'], data['nickname'])
The team name can be found under data['name'].
Logs/Data
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/espn_api/basketball/league.py", line 20, in __init__
self.fetch_league()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/espn_api/basketball/league.py", line 24, in fetch_league
self._fetch_teams(data)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/espn_api/basketball/league.py", line 51, in _fetch_teams
super()._fetch_teams(data, TeamClass=Team, pro_schedule=pro_schedule)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/espn_api/base_league.py", line 64, in _fetch_teams
self.teams.append(TeamClass(team, roster=roster, member=member, schedule=schedule, year=seasonId, pro_schedule=pro_schedule))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/espn_api/basketball/team.py", line 11, in __init__
self.team_name = "%s %s" % (data['location'], data['nickname'])
KeyError: 'location'
Sport
Basketball
Summary
Just calling
League(league_id=league_id, year=curr_season, espn_s2=espn_s2, swid=espn_swid)
gives an errorKeyError: 'location'
. I'm guessing this is an issue with ESPN, as now the issue stems from this part of the League class.self.team_name = "%s %s" % (data['location'], data['nickname'])
The team name can be found under
data['name']
.Logs/Data