guoguo12 / billboard-charts

Python API for downloading Billboard charts.
https://pypi.python.org/pypi/billboard.py
MIT License
389 stars 117 forks source link

Issue with old style? #82

Open NathanTech7713 opened 3 years ago

NathanTech7713 commented 3 years ago

Hi folks,

I'm not even sure how to explain this one myself. For me, billboard works perfectly, but when bundled as part of a package, a couple of users report errors when opening charts. From the error report I receive this traceback: "billboard.py", line 190, in init File "billboard.py", line 487, in fetchEntries File "billboard.py", line 459, in _parsePage File "billboard.py", line 236, in _parseOldStylePage File "_strptime.py", line 568, in _strptime_datetime File "_strptime.py", line 349, in _strptime ValueError: time data 'April 10, 2021' does not match format '%B %d, %Y'"

When, it quite obviously does? Should I just force old_style to go through new_style? Any ideas here would be appreciated as I'm at the point where i'm wondering if python has been having some of the good stuff behind my back!

Python version 3.8.6,

guoguo12 commented 3 years ago

Oh, interesting. I bet it's because %B varies by locale.

guoguo12 commented 3 years ago

Can't fix this right now, but perhaps you could add some code to set the locale to en_US and then have your users try again.