【发布时间】:2021-09-01 11:48:58
【问题描述】:
我正在尝试将默认值文件保存到 S3 存储桶,但出现以下错误:
An error occurred while calling o654.__getstate__. Trace:
py4j.Py4JException: Method __getstate__([]) does not exist
at py4j.reflection.ReflectionEngine.getMethod(ReflectionEngine.java:318)
at py4j.reflection.ReflectionEngine.getMethod(ReflectionEngine.java:326)
at py4j.Gateway.invoke(Gateway.java:274)
at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
at py4j.commands.CallCommand.execute(CallCommand.java:79)
at py4j.GatewayConnection.run(GatewayConnection.java:238)
at java.lang.Thread.run(Thread.java:748)
我准备的代码sn-p,好像是py4j相关的问题。
感谢您的建议!
BUCKET = 'my_bucket'
s3 = boto3.client('s3')
keyid = 'xxxxx'
print("Uploading S3 object with SSE-KMS")
s3.put_object(Bucket=BUCKET,
Key='encrypt-key',
Body=b'foobar',
ServerSideEncryption='aws:kms',
# Optional: SSEKMSKeyId
SSEKMSKeyId=keyid)
print("Saving to S3, Done")
【问题讨论】:
-
检查此问题是否与此处的问题不相似:stackoverflow.com/questions/40470487/…
标签: python amazon-s3 aws-glue py4j