Strange cgi.rb <--> StringIO problem

Hi,

I hope someone can help me figure out this strange behaviour because
I’ve been at it for hours …

Problem:
When reading multipart data with cgi.rb I get an initialization
error: "undefined method `binmode’ for #StringIO:0x4032df14"
at about line 657 in cgi.rb.

Investigation reveals that the method binmode does not exist on my
StringIO because it is not the standard StringIO (I don’t have it
installed); in irb StringIO is not defined and cannot be loaded. In
cgi.rb however StringIO is defined and StringIO.superclass returns
’Object’ (and not ‘Data’ as one would expect).

Does anyone know what is going on ?

My configuration:
Debian GNU/Linux (unstable)
ruby 1.6.8-3
libruby 1.6.8-3

$LOAD_PATH (in irb and cgi.rb):
/usr/local/lib/site_ruby/1.6
/usr/local/lib/site_ruby/1.6/i386-linux
/usr/local/lib/site_ruby
/usr/lib/ruby/1.6
/usr/lib/ruby/1.6/i386-linux

Puzzled,
Simon

P.S.: In previous versions cgi.rb did not use StringIO (only TempFile)
and I didn’t have this problem.

···


Lord, what fools these mortals be!
– William Shakespeare, “A Midsummer-Night’s Dream”

Note that installing the shim package (that contains StringIO) solved
the problem. I’d still like to know what was going on :O)

Simon

···


Lord, what fools these mortals be!
– William Shakespeare, “A Midsummer-Night’s Dream”