Marshal.load should raise EOFError if the file to load from is empty
--------------------------------------------------------------------

                 Key: JRUBY-2345
                 URL: http://jira.codehaus.org/browse/JRUBY-2345
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.1.1
         Environment: Latest JRuby from trunk.
            Reporter: Vladimir Sizikov
            Assignee: Vladimir Sizikov
            Priority: Minor
             Fix For: JRuby 1.1.1


The following code:

{noformat}
f = File.new('tmp-file', "w+")
Marshal.load(f)
{noformat}

Produces in MRI:
EOFError: end of file reached

But in JRuby:
IOError: Unexpected end of stream

This leads to the following rubyspec failure:
{noformat}
Marshal::load raises EOFError on loading an empty file FAILED
Expected EOFError but got IOError (Unexpected end of stream)
/opt/work/rbx.git/./mspec/expectations.rb:10:in `fail_with'
/opt/work/rbx.git/./mspec/expectations/should.rb:6:in `should'
/opt/work/rbx.git/./spec/ruby/1.8/core/marshal/load_spec.rb:217:in 
`/opt/work/rbx.git/./spec/ruby/1.8/core/marshal/load_spec.rb'
/opt/work/rbx.git/./mspec/runner/mspec.rb:112:in `call'
/opt/work/rbx.git/./mspec/runner/mspec.rb:112:in `protect'
/opt/work/rbx.git/./mspec/runner/state.rb:46:in `each'
/opt/work/rbx.git/./mspec/runner/state.rb:46:in `protect'
/opt/work/rbx.git/./mspec/runner/state.rb:60:in `process'
/opt/work/rbx.git/./mspec/runner/state.rb:56:in `each'
/opt/work/rbx.git/./mspec/runner/state.rb:56:in `process'
/opt/work/rbx.git/./mspec/runner/mspec.rb:19:in `describe'
/opt/work/rbx.git/./mspec/runner/object.rb:11:in `describe'
/opt/work/rbx.git/./spec/ruby/1.8/core/marshal/load_spec.rb:4:in 
`/opt/work/rbx.git/./spec/ruby/1.8/core/marshal/load_spec.rb'
/opt/work/rbx.git/./spec/ruby/1.8/core/marshal/load_spec.rb:37:in `load'
/opt/work/rbx.git/./mspec/runner/mspec.rb:37:in `files'
/opt/work/rbx.git/./mspec/runner/mspec.rb:112:in `call'
/opt/work/rbx.git/./mspec/runner/mspec.rb:112:in `protect'
/opt/work/rbx.git/./mspec/runner/mspec.rb:37:in `files'
/opt/work/rbx.git/./mspec/runner/mspec.rb:34:in `each'
/opt/work/rbx.git/./mspec/runner/mspec.rb:34:in `files'
/opt/work/rbx.git/./mspec/runner/mspec.rb:26:in `process'
mspec/bin/mspec-ci:59
{noformat}

Fix in progress.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to