[GH-ISSUE #909] [WhoScored] ValueError: time data 'Aug' does not match format '%b' #199

Open
opened 2026-03-02 15:56:36 +03:00 by kerem · 4 comments
Owner

Originally created by @salvassc on GitHub (Dec 22, 2025).
Original GitHub issue: https://github.com/probberechts/soccerdata/issues/909

Describe the bug
With Python version 3.10.11 and soccerdata library version 1.8.7, I get the error "ValueError: time data 'Aug' does not match format '%b'" when executing calls to some functions

Affected scrapers
This affects the following scrapers:

  • ClubElo
  • ESPN
  • FBref
  • FiveThirtyEight
  • FotMob
  • Match History
  • SoFIFA
  • Understat
  • WhoScored

Code example

whoscored = sd.WhoScored()

ws = sd.WhoScored(leagues="ENG-Premier League", seasons=2021)

epl_schedule = ws.read_schedule()
epl_schedule.head()

# Injured and suspended players
missing_players = ws.read_missing_players(match_id=1485184)
missing_players.head()

Error message

ValueError: time data 'Aug' does not match format '%b'
Originally created by @salvassc on GitHub (Dec 22, 2025). Original GitHub issue: https://github.com/probberechts/soccerdata/issues/909 **Describe the bug** With Python version 3.10.11 and soccerdata library version 1.8.7, I get the error "ValueError: time data 'Aug' does not match format '%b'" when executing calls to some functions **Affected scrapers** This affects the following scrapers: - [ ] ClubElo - [ ] ESPN - [ ] FBref - [ ] FiveThirtyEight - [ ] FotMob - [ ] Match History - [ ] SoFIFA - [ ] Understat - [X] WhoScored **Code example** ```python whoscored = sd.WhoScored() ws = sd.WhoScored(leagues="ENG-Premier League", seasons=2021) epl_schedule = ws.read_schedule() epl_schedule.head() # Injured and suspended players missing_players = ws.read_missing_players(match_id=1485184) missing_players.head() ``` **Error message** ``` ValueError: time data 'Aug' does not match format '%b' ```
Author
Owner

@probberechts commented on GitHub (Jan 6, 2026):

Is your OS or Python environment set to a non-English locale? You can check this by running the following in Python:

import locale
print(locale.getlocale(locale.LC_TIME))

If that is the issue, you can fix this by forcing an English locale in your session:

import locale
locale.setlocale(locale.LC_TIME, "C")

or by setting an environment variable

export LC_ALL=C

The ideal long-term fix would be for soccerdata to parse dates using locale-independent logic or explicitly set locale when parsing. But until that’s changed upstream, the above would be an easy workaround.

<!-- gh-comment-id:3714861422 --> @probberechts commented on GitHub (Jan 6, 2026): Is your OS or Python environment set to a non-English locale? You can check this by running the following in Python: ```py import locale print(locale.getlocale(locale.LC_TIME)) ``` If that is the issue, you can fix this by forcing an English locale in your session: ```py import locale locale.setlocale(locale.LC_TIME, "C") ``` or by setting an environment variable ```sh export LC_ALL=C ``` --- The ideal long-term fix would be for `soccerdata` to parse dates using locale-independent logic or explicitly set locale when parsing. But until that’s changed upstream, the above would be an easy workaround.
Author
Owner

@salvassc commented on GitHub (Jan 13, 2026):

Yes, my OS non English locale

import locale
print(locale.getlocale(locale.LC_TIME))

('es_ES', 'cp1252')

If i use locale.setlocale(locale.LC_TIME, "C"), do i have to add that code to every cell.

Is there a way to apply that to all cells in my Jupiter Notebook?

<!-- gh-comment-id:3743607428 --> @salvassc commented on GitHub (Jan 13, 2026): Yes, my OS non English locale ```python import locale print(locale.getlocale(locale.LC_TIME)) ('es_ES', 'cp1252') ``` If i use locale.setlocale(locale.LC_TIME, "C"), do i have to add that code to every cell. Is there a way to apply that to all cells in my Jupiter Notebook?
Author
Owner

@probberechts commented on GitHub (Jan 13, 2026):

Running it once at the beginning of your notebook should be sufficient. You can also start your notebook server with a specific locale by running:

LC_ALL=C jupyter notebook
<!-- gh-comment-id:3743653608 --> @probberechts commented on GitHub (Jan 13, 2026): Running it once at the beginning of your notebook should be sufficient. You can also start your notebook server with a specific locale by running: ```sh LC_ALL=C jupyter notebook ```
Author
Owner

@salvassc commented on GitHub (Jan 13, 2026):

Thanks for the suggestion. I tried running import locale; locale.setlocale(locale.LC_TIME, "C") at the very beginning of the notebook, before importing soccerdata.

However, in VS Code with Jupyter on Windows, this does not reliably apply to the whole notebook: it only works in the cell where it is executed, and subsequent cells still fail with the same locale-related error.

I understand that starting Jupyter with LC_ALL=C would be the cleanest solution, but this has been difficult to apply consistently in my Windows environment.

<!-- gh-comment-id:3743769042 --> @salvassc commented on GitHub (Jan 13, 2026): Thanks for the suggestion. I tried running ```import locale; locale.setlocale(locale.LC_TIME, "C")``` at the very beginning of the notebook, before importing soccerdata. However, in VS Code with Jupyter on Windows, this does not reliably apply to the whole notebook: it only works in the cell where it is executed, and subsequent cells still fail with the same locale-related error. I understand that starting Jupyter with LC_ALL=C would be the cleanest solution, but this has been difficult to apply consistently in my Windows environment.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/soccerdata#199
No description provided.