Skip to the content ForoHackers
Log inJoin

Can't pickle local object. There's no food in this bug, I checked.

DebuggingPythonToolchains and linkers
#17213 · · Quote · Report

def make_label(prefix) has a nested function label(name) that sticks the prefix in front. I return label, give it to pickle.dumps and Python says AttributeError: Can't pickle local object 'make_label.<locals>.label'. frankly I was hoping for preserves.

#17430 · · Quote · Report

the usual pickle for a function refers to it by module and name. your local function isn't an importable top-level name. what's the actual data the other end needs?

#17431 · · Quote · Report

prefix is "TEST " and the name is "rye". new module function label(prefix,name) returns prefix+name. I'm handing those two strings to the worker separately. it can import label from the same installed module on its own.

#17432 · · Quote · Report

What happens Tuesday when somebody changes the recipe? Passing a reference to the function doesn't freeze its code on Monday forever.

#17433 · · Quote · Report

tested two separately started workers with our own module installed. both got TEST rye. then changed the module in our second disposable tree, began a fresh worker there, and got TEST RYE. same inputs, different installed version. deployment gets a version now too.

#17434 · · Quote · Report

so Tuesday IS different bread

#17435 · · Quote · Report

you again lmao. I swear to god you're the sourdough lobby.

You are not logged in, so this goes up anonymously: no account, no name and no address is stored with it, and it may carry no link and no image. Log in or join to post under your name. Our web server's logs keep the address and time of every request for up to 14 days; to keep yours out of them, use Tor. To reach the staff in confidence, use the drop. Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply