[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] pyg_mixer.music.load doesn't take non ascii chars



Greg Ewing skrev den 2015-02-14 12:46:
Bo Jangeborg wrote:

According to the documentation
one should be able to pass an object as a parameter
but I am not sure if I am doing it the right way.

I think it means a file object, not the file contents:

  file_path = "07-Boabdil, Bulerías.ogg"
  fi = open(file_path, 'rb')
  pygame.mixer.music.load(fi)

If open() is able to handle the unicode file
name, that ought to work.

the open() command by it self works, so
python can handle the unicode string,
but the following doesn't work.

  file_path = "07-Boabdil, Bulerías.ogg"
  pygame.mixer.music.load(file_path)