Decoding doesn't help here.
I am using # -*- coding: utf8 -*-

Your saying that it works for you, did
you try that specific file name ?
"07-Boabdil, Bulerías.ogg"

Gino Ingras skrev den 2015-02-14 09:43:
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 <mailto: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