Marshal gives error when dumping and loading array with two regexpsin latest ruby 1.9

S

Stefano Crocco

I just upgraded my ruby 1.9 to the latest stable version (ruby 1.9.1-p243),
and now I'm facing a strange issue. The problem is that attempting to use
Marshal to dump and then load back an array containing two Regexps gives an
error. For example:

str = Marshal.dump [/a/, /b/]
Marshal.load str

This gives the following error:

/home/stefano/documents/scripts/prova.rb:4:in `load': can't convert Regexp
into String (TypeError)
from /home/stefano/documents/scripts/prova.rb:4:in `<main>'

The above code worked perfectly with the previous version of ruby 1.9.1. Has
anybody noticed the same issue?

Thanks in advance

Stefano
 
W

Wayne Vucenic

I just upgraded my ruby 1.9 to the latest stable version (ruby 1.9.1-p243),
str = Marshal.dump [/a/, /b/]
Marshal.load str
This gives the following error:
/home/stefano/documents/scripts/prova.rb:4:in `load': can't convert Regexp

Hi Stefano,

I get the same error you do with ruby 1.9.1-p243. This code works
fine with 1.8.6.

Sorry that I don't know what might be causing this problem.

HTH,

Wayne
 
S

Stefano Crocco

|> I just upgraded my ruby 1.9 to the latest stable version (ruby
|> 1.9.1-p243),
|>
|> str = Marshal.dump [/a/, /b/]
|> Marshal.load str
|>
|> This gives the following error:
|> /home/stefano/documents/scripts/prova.rb:4:in `load': can't convert
|> Regexp
|
|Hi Stefano,
|
|I get the same error you do with ruby 1.9.1-p243. This code works
|fine with 1.8.6.
|
|Sorry that I don't know what might be causing this problem.
|
|HTH,
|
|Wayne
|

Since I'm not the only one to experience this issue, I'll report it as a bug.

Thanks

Stefano
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top