Open ilyacherevkov opened 5 days ago
Fixed it by changing in fbref.py
filepath = self.data_dir / filemask.format(team, skey, stat_type)
to
filepath = self.data_dir / filemask.format(team.replace('/',''), skey, stat_type)
Not sure if it breaks anything, though.
No, it won't break anything. A more generic solution would be to use something like Django's slugify()
function.
Describe the bug Unable to use team_match_stats for teams with slash in the name, like Bodø/Glimt.
It tries to create file matchlogs_Bodø/Glimt_2022_schedule.html, which resolves incorrectly due to slash in the name.
Affected scrapers This affects the following scrapers:
Code example A minimal code example that fails. Use
no_cache=True
to make sure an invalid cached file does not cause the bug and make sure you have the latest version of soccerdata installed.Error message
Additional context Note, line number in _common.py with the error might differ, as I did minor changes in the code.
Contributor Action Plan