[GH-ISSUE #4] Invalid song dates make Rofi_MPD crash #6

Closed
opened 2026-05-22 22:02:29 +01:00 by JakeStanger · 4 comments
Owner

Originally created by @monsieurh on GitHub (Oct 5, 2018).
Original GitHub issue: https://github.com/JakeStanger/Rofi_MPD/issues/4

When I try to run the program I have the following error:


Traceback (most recent call last):
  File "main.py", line 119, in <module>
    'epoch': get_album_release_epoch(song_data=song),
  File "main.py", line 86, in get_album_release_epoch
    epoch = datetime.datetime(int(year), int(month), int(day))
ValueError: month must be in 1..12

I assume some of my songs have invalid dates

Originally created by @monsieurh on GitHub (Oct 5, 2018). Original GitHub issue: https://github.com/JakeStanger/Rofi_MPD/issues/4 When I try to run the program I have the following error: ``` Traceback (most recent call last): File "main.py", line 119, in <module> 'epoch': get_album_release_epoch(song_data=song), File "main.py", line 86, in get_album_release_epoch epoch = datetime.datetime(int(year), int(month), int(day)) ValueError: month must be in 1..12 ``` I assume some of my songs have invalid dates
Author
Owner

@rubdos commented on GitHub (Oct 5, 2018):

related #3

<!-- gh-comment-id:427275559 --> @rubdos commented on GitHub (Oct 5, 2018): related #3
Author
Owner

@JakeStanger commented on GitHub (Oct 5, 2018):

Fixed by #5 for now

<!-- gh-comment-id:427327038 --> @JakeStanger commented on GitHub (Oct 5, 2018): Fixed by #5 for now
Author
Owner

@rubdos commented on GitHub (Oct 5, 2018):

Another one:

Traceback (most recent call last):
  File "/usr/bin/rofi-mpd", line 122, in <module>
    'epoch': get_album_release_epoch(song_data=song),
  File "/usr/bin/rofi-mpd", line 78, in get_album_release_epoch
    epoch = datetime.datetime(year, 1, 1)
ValueError: year 0 is out of range

I indeed have an album with year 0 :-)

<!-- gh-comment-id:427342850 --> @rubdos commented on GitHub (Oct 5, 2018): Another one: ``` Traceback (most recent call last): File "/usr/bin/rofi-mpd", line 122, in <module> 'epoch': get_album_release_epoch(song_data=song), File "/usr/bin/rofi-mpd", line 78, in get_album_release_epoch epoch = datetime.datetime(year, 1, 1) ValueError: year 0 is out of range ``` I indeed have an album with year 0 :-)
Author
Owner

@JakeStanger commented on GitHub (Oct 5, 2018):

Addressed in #3

<!-- gh-comment-id:427515030 --> @JakeStanger commented on GitHub (Oct 5, 2018): Addressed in #3
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
JakeStanger/Rofi_MPD#6
No description provided.