Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pickle Machine failed on opcode:0x81 #22

Open
chanleeli opened this issue May 11, 2019 · 3 comments
Open

Pickle Machine failed on opcode:0x81 #22

chanleeli opened this issue May 11, 2019 · 3 comments

Comments

@chanleeli
Copy link

err: Pickle Machine failed on opcode:0x81. Stack size:1. Memo size:0. Cause:Input encountered opcode that is not implemented

i need unpickle an instance of a Python object with golang now, can you help me fix it out?

@hydrogen18
Copy link
Owner

If you can provide example python code that generates a pickled object containing this byte code I may be able to help.

@iris-qq
Copy link

iris-qq commented Nov 26, 2019

Pickle Machine failed on opcode:0x80. Stack size:0. Memo size:0. Cause:Unsupported version #3 detected

python (3.6.5):

with open("pickletest.pkl","wb") as f:
    f.write(pickle.dumps([1,1,1]))

golang (1.11.2):

package main

import (
	"fmt"
	"github.com/hydrogen18/stalecucumber"
	"os"
)

func main(){
	//var somePickleData io.Reader
	file,err:=os.Open("./static/pickletest.pkl")
	if err !=nil{
		_ =file.Close()
		panic(err)
	}
	numbers:=make([]interface{},0)
	err =stalecucumber.UnpackInto(&numbers).From(stalecucumber.Unpickle(file))
	if err !=nil{
		fmt.Println(err)
	}
	fmt.Println(numbers)
}

error:

Pickle Machine failed on opcode:0x80. Stack size:0. Memo size:0. Cause:Unsupported version #3 detected
[]

@iris-qq
Copy link

iris-qq commented Nov 26, 2019

Pickle Machine failed on opcode:0x80. Stack size:0. Memo size:0. Cause:Unsupported version #3 detected

python (3.6.5):

with open("pickletest.pkl","wb") as f:
    f.write(pickle.dumps([1,1,1]))

golang (1.11.2):

package main

import (
	"fmt"
	"github.com/hydrogen18/stalecucumber"
	"os"
)

func main(){
	//var somePickleData io.Reader
	file,err:=os.Open("./static/pickletest.pkl")
	if err !=nil{
		_ =file.Close()
		panic(err)
	}
	numbers:=make([]interface{},0)
	err =stalecucumber.UnpackInto(&numbers).From(stalecucumber.Unpickle(file))
	if err !=nil{
		fmt.Println(err)
	}
	fmt.Println(numbers)
}

error:

Pickle Machine failed on opcode:0x80. Stack size:0. Memo size:0. Cause:Unsupported version #3 detected
[]

pickle.dumps(xxxx,2),sloved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants