Skip to content
This repository was archived by the owner on Jan 11, 2022. It is now read-only.
This repository was archived by the owner on Jan 11, 2022. It is now read-only.

Loading cPickle file #30

@arjunmenon

Description

@arjunmenon

I am getting a type conversion error

irb(main):036:0> f = open('distributions.obj', 'rb')
=> #<File:distributions.obj>
irb(main):037:0> uniDist = cPickle.loads(f).rubify
RubyPython::Conversion::UnsupportedConversion: Unsupported type File for conversion.
	from /home/arjun/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rubypython-0.6.4/lib/rubypython/conversion.rb:199:in `rtopObject'
	from /home/arjun/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rubypython-0.6.4/lib/rubypython/conversion.rb:40:in `block in rtopArrayToList'
	from /home/arjun/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rubypython-0.6.4/lib/rubypython/conversion.rb:36:in `each'
	from /home/arjun/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rubypython-0.6.4/lib/rubypython/conversion.rb:36:in `each_with_index'
	from /home/arjun/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rubypython-0.6.4/lib/rubypython/conversion.rb:36:in `rtopArrayToList'
	from /home/arjun/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rubypython-0.6.4/lib/rubypython/conversion.rb:49:in `rtopArrayToTuple'
	from /home/arjun/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rubypython-0.6.4/lib/rubypython/pyobject.rb:187:in `buildArgTuple'
	from /home/arjun/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rubypython-0.6.4/lib/rubypython/rubypyproxy.rb:188:in `_method_call'
	from /home/arjun/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rubypython-0.6.4/lib/rubypython/rubypyproxy.rb:169:in `method_missing'
	from (irb):37
	from /home/arjun/.rbenv/versions/2.2.3/bin/irb:11:in `<main>'

This is the python code I am trying to run -

    f = open('distributions.obj', 'rb')
    uniDist = cPickle.load(f)
    backwardBiDist = cPickle.load(f)
    forwardBiDist = cPickle.load(f)
    trigramDist = cPickle.load(f)
    wordCasingLookup = cPickle.load(f)
    f.close()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions