Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error if the Bookmarks field is present but empty #117

Open
120-cell opened this issue Dec 11, 2023 · 0 comments
Open

Error if the Bookmarks field is present but empty #117

120-cell opened this issue Dec 11, 2023 · 0 comments

Comments

@120-cell
Copy link

Some beatmap files contain a line for Bookmarks without any values like this:

[Editor]
Bookmarks:

Presumably they have been manually edited, since the editor will not generate a line for bookmarks if there are none. Here's the map where I found the issue:
Sasaki Sayaka - Golden Mission (yuzu__rinrin) [Futsuu].osu.txt

The game will still accept such files, but the parser throws an error:

Exception has occurred: ValueError       (note: full exception trace is shown but execution is paused at: _run_module_as_main)
field 'Bookmarks' in section 'Editor' should be an int list, got ''
  File "/usr/lib/python3.11/site-packages/slider/beatmap.py", line 1115, in _get_as_int_list
    return [int(e.strip()) for e in v.split(',')]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/slider/beatmap.py", line 1115, in <listcomp>
    return [int(e.strip()) for e in v.split(',')]
            ^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''

During handling of the above exception, another exception occurred:

  File "/usr/lib/python3.11/site-packages/slider/beatmap.py", line 1117, in _get_as_int_list
    raise ValueError(
  File "/usr/lib/python3.11/site-packages/slider/beatmap.py", line 2600, in parse
    timedelta(milliseconds=ms) for ms in _get_as_int_list(
                                         ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/slider/beatmap.py", line 2398, in from_file
    return cls.parse(file.read())
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/slider/beatmap.py", line 2349, in from_path
    return cls.from_file(file)
           ^^^^^^^^^^^^^^^^^^^
ValueError: field 'Bookmarks' in section 'Editor' should be an int list, got ''
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

No branches or pull requests

1 participant