[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] File-like objects and mixer.Sound



In article <001901c0def4$3c3ea9a0$0200a8c0@petebox> you wrote:
>> I can't seem to get file-like objects (specifically StringIO) to
>> work with pygame.mixer.Sound(). Transcript:
>> 
>> I'm not sure what's supposed to happen here, or whether I'm doing
>> something wrong, but I *am* sure that it's not supposed to segfault,
>> it's supposed to give me a traceback :) Any suggestions? I'm
>> using the Debian pygame 1.0 package on a Debian woody system -- I
>> can provide other version numbers or whatever on request.
> 
> hi aquarius, this was a bug in the 1.0 release. if you grab 
> the code from cvs, you'll see it's been fixed up.

Ah. Bummer, that means I have to compile stuff from source rather than
using the debs :)
 
> also, in you code, you should use "file = open(...).read()"
> not readlines. the StringIO object works over a single
> string representing the entire data. readlines() returns
> a list of strings, and i'm sure the results are pretty odd
> with a binary file. (i'm surprised that didn't give a
> python error?)

I know -- that was me being dim in producing an example of code that
failed. The real code, in which I first found the error, doesn't do it
that way, so I knew that that wasn't the problem :)
 
> checking the "WhatsNew" log ( http://www.pygame.org/WhatsNew )
> it shows that this was fixed back on April 30th. thanks for the
> bug report though, if this was the first i'd heard about this
> problem i'd be going into "maintainer panic mode" :]

Ah-ha, yes, shoot me for not looking at the changelog. As I mentioned
in another post, there seems to be the same problem with
pygame.image.load(), too -- the changelog only mentions Sound() being
fixed for this bug.

How often do the Debian packages get rebuilt? I'd build them myself if
I knew the first thing about it, but I don't, because I'm avoiding
learning so I don't become a developer and use up all of my remaining
Copious Free Time (TM).

Aq -- I suppose I could do the XML bit of the code first and then come
back to the SDl bit. Bah, I hate the XML parser :)

-- 
Well *done*, Aquarius -- a phrase we love typing because it makes us feel
like the boss-character from a 1980s Glen A Larson action series...
  NTK, http://www.ntk.net/index.cgi?backarchive99/now0618.txt&lineY2#l
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org