Duckapple / Kat

Kattis shell for getting examples, testing and submitting.
19 stars 6 forks source link

Play sound crashes on windows, not sure why :) #89

Closed MikkelNilsson closed 2 years ago

MikkelNilsson commented 2 years ago
Traceback (most recent call last):
  File "D:\.Projekter\Kat\kattis.py", line 41, in main
    execCommand[command](data)
  File "D:\.Projekter\Kat\commands\submit.py", line 81, in submitCommand
    winsound()
  File "D:\.Projekter\Kat\helpers\sound.py", line 8, in winsound
    playsound(random.choice(glob.glob(prefix + "/win/*.mp3")))
  File "C:\Users\mikke\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\playsound.py", line 72, in _playsoundWin
    winCommand(u'open {}'.format(sound))
  File "C:\Users\mikke\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\playsound.py", line 64, in winCommand
    raise PlaysoundException(exceptionMessage)
playsound.PlaysoundException: 
    Error 305 for command:
        open "D:\.Projekter\Kat\helpers/../resources//win\win.mp3"
    Der kan ikke angives ekstra tegn efter en streng, som er omgivet af anførelsestegn.
Duckapple commented 2 years ago

I have pushed what I think is a fix to master -- could you check whether it works?

MikkelNilsson commented 2 years ago

Hey, just tested it out. It works now 👍