pygame is sharing code with you

Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.

Don't show this again

pygame / pygame http://pygame.org/

Clone this repository (size: 15.4 MB): HTTPS / SSH
hg clone https://bitbucket.org/pygame/pygame
hg clone ssh://hg@bitbucket.org/pygame/pygame

Issues

#37 pygame.mixer.music.load doesn't work with unicode symbols in path

Reported by illume

Vasiliy, 2009-09-01 11:32:23 -0700

This method doesn't work with unicode symbols in os path.
For example:
audiofile = u'D:/Work/Projects/Programming/iTutor/src/iTutor/dictionaries/Казахо - Русский/3.mp3'
pygame.mixer.music.load(audiofile)

return error:
pygame.error: Couldn't read from 'D:/Work/Projects/Programming/iTutor/src/iTutor/dictionaries/Казахо - Русский/3.mp3'

if i'm delete 'Казахо - Русский/' from audiofile variable then method working normally.

Status: open Responsible: illume Type: bug Priority: trivial
Milestone: none Component: none Version: none

Attachments

No attachments added for this issue yet.

Comments and changes

  1. #1 illume

    written

    • Changed milestone from nothing to 1.9.2.
    • Changed status from new to open.

    This works with oggs and wavs on OSX.

    I assume this is another smpeg error. Or perhaps a windows related error.

    Needs testing on windows.

  2. #2 Lenard Lindstrom

    written

    According to the Python 2.7 sys.getfilesystemencoding() docs no encoding is done to the file path. So the UTF-16 Python string is just passed through. I don't know what encoding Windows uses, thought.

  3. #3 Anonymous

    written

    I think this might be a bytes/unicode misunderstanding: I've tested this only on linux, on an utf8 filesystem, but pygame.mixer.music.load('<utf8 encoded string>') worked, whereas pygame.mixer.music.load(u'<utf8 encoded string>') didn't., but pygame.mixer.music.load(u'<utf8 encoded string>'.encode('utf8')) again did.

Add comment / attachment

Verification: Please write the text from the image in the box (letters only)

captcha

Is that you, Humanoid? Is this me?