Skip to content

Base process manager does not allow a processor to return bytes as the generated output anymore #2304

@ricardogsilva

Description

@ricardogsilva

If using a builtin process manager, such as the tinydb, mongo or postgresql ones, which all delegate to the base manager's _execute_handler_sync() at some point, when an executing process generates bytes as its output, the process manager converts it to a UTF-8 string, as seen in:

if isinstance(outputs, bytes):
outputs = outputs.decode('utf-8')

I guess this means that support for binary output types (for example, a geotiff file) is now broken?

Further down in the same method, there is still a check for bytes, as per:

elif isinstance(outputs, bytes):
mode = 'wb'
data = outputs
encoding = None

but the code inside this if condition is now not reachable, because the type of outputs has been modified to a str above.

@tomkralidis this seems like a regression introduced in this recent change: 0b53d49

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions