apache / apache/openwhisk-composer-python

sample does not work with openwhisk python 3 runtime

Open
#15 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
9
Forks
12
PR merge metrics
No merged PRs in 30d

Description

You can use this sample code (save as `fn.py`):
```
import types
import marshal
import base64
__code__= types.FunctionType(marshal.loads(base64.b64decode(bytearray('4wEAAAAAAAAAAAAAAAEAAAADAAAAUwAAAHMQAAAAZAF8AGQCGQBkA2sCaQFTACkETtoFdmFsdWXaCHBhc3N3b3Jk2gZhYmMxMjOpAKkB2gRhcmdzcgQAAAByBAAAANoIPHN0cmluZz7aCDxsYW1iZGE+BQAAAPMAAAAA', 'ASCII'))), {})
def main(args):
return __code__(args)
```

And run it locally:
```
> docker run -d -p 8080:8080 openwhisk/python3action:nightly
> openwhisk/tools/actionProxy/invoke.py init fn.py
{"error":"The action failed to generate or locate a binary. See logs for details."}
```

The container logs show:
```
Traceback (most recent call last):
ValueError: bad marshal data (unknown type code)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.