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

Missplaced Commas in BPMs cause ValueError #38

Closed
bjfranks opened this issue Feb 15, 2023 · 1 comment
Closed

Missplaced Commas in BPMs cause ValueError #38

bjfranks opened this issue Feb 15, 2023 · 1 comment
Labels
duplicate non-strict parsing bugs related to malformed simfiles that StepMania accepts

Comments

@bjfranks
Copy link

Processing one erroneous song causes a ValueError. Namely, there are too many commas in the bpms, which then get split and end up in empty strings which cannot be split by = and unpacked into two values. Here is one of the errors, it's caused for all charts because it's in the main bpms.

Miss You 0
Traceback (most recent call last):
  File "...", line 8, in calculate_statistics
    timing_data = TimingData(simfileInstance, simfileInstance.charts[chart])
  File "D:\Meatball\venv\lib\site-packages\simfile\timing\__init__.py", line 210, in __init__
    self.bpms = BeatValues.from_str(simfile_or_chart.bpms)
  File "D:\Meatball\venv\lib\site-packages\simfile\timing\__init__.py", line 174, in from_str
    beat, value = row.strip().split("=")
ValueError: not enough values to unpack (expected 2, got 1)

Also, here is the offending part of the file, which is attached below:

#BPMS:0.000000=132.000000
,172.000000=99.000000
,172.250000=49.500000
,172.500000=66.000000
,205.000000=-132,
,209.000000=132,
,213.000000=-132,
,217.000000=132,
,221.000000=-132,
,225.000000=132,
,229.000000=-132,
,232.875000=132
;

missyou.zip

@garcia garcia added the non-strict parsing bugs related to malformed simfiles that StepMania accepts label Feb 18, 2023
@garcia
Copy link
Owner

garcia commented Jun 18, 2024

This is now fixed on the v3 branch for non-strict parsed simfiles.

This is a duplicate of #4, so will follow up there once v3 is stable.

@garcia garcia closed this as completed Jun 18, 2024
@garcia garcia closed this as not planned Won't fix, can't repro, duplicate, stale Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate non-strict parsing bugs related to malformed simfiles that StepMania accepts
Projects
None yet
Development

No branches or pull requests

2 participants