assume in line 2:
# -*- coding: utf8 -*-
...
from codecs import open
...
#don't know if your file_path is hard coded, if not you may
file_path = file_path.decode('utf8')
...
#and then, as Greg told:
pygame.mixer.music.load(open(file_path))

work fine on win7 and linux(Mint17)


2015-02-14 2:00 GMT+01:00 Greg Ewing <greg.ew...@canterbury.ac.nz>:

> Bo Jangeborg wrote:
>
>> file_path = "07-Boabdil, BulerĂ­as.ogg"
>> fi = open(file_path, 'rb').read()
>> pygame.mixer.music.load(fi)
>>
>> But that gets me the Error:
>> "File path 'OggS' contains null characters"
>>
>
> music.load() expects to be passed the name of a file,
> not the contents of the file. Just do this:
>
>
> file_path = "07-Boabdil, BulerĂ­as.ogg"
> pygame.mixer.music.load(file_path)
>
> --
> Greg
>

Reply via email to