Skip to content

handle non-intable strings better#99

Open
thingscouldbeworse wants to merge 1 commit intoguoguo12:masterfrom
thingscouldbeworse:master
Open

handle non-intable strings better#99
thingscouldbeworse wants to merge 1 commit intoguoguo12:masterfrom
thingscouldbeworse:master

Conversation

@thingscouldbeworse
Copy link

Getting errors today of the shape

Traceback (most recent call last):
  File "/home/user/.local/lib/python3.8/site-packages/billboard.py", line 374, in getMeta
    return int(value)
ValueError: invalid literal for int() with base 10: ''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  ...
  File "/home/user/.local/lib/python3.8/site-packages/billboard.py", line 190, in __init__
    self.fetchEntries()
  File "/home/user/.local/lib/python3.8/site-packages/billboard.py", line 489, in fetchEntries
    self._parsePage(soup)
  File "/home/user/.local/lib/python3.8/site-packages/billboard.py", line 463, in _parsePage
    self._parseNewStylePage(soup)
  File "/home/user/.local/lib/python3.8/site-packages/billboard.py", line 382, in _parseNewStylePage
    weeks = getMeta("week", 5, ifNoValue=1)
  File "/home/user/.local/lib/python3.8/site-packages/billboard.py", line 377, in getMeta
    raise BillboardParseException(message)
billboard.BillboardParseException: Failed to parse metadata value: week

Seems like the fix in this PR is the easiest, just return our ifNotValue for anything that isn't intable.

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

Successfully merging this pull request may close these issues.

1 participant