Actions
Bug #21718
openregression calling decode() on memoryview returned by ArvFile
Status:
In Progress
Priority:
Normal
Assigned To:
Category:
CWL
Target version:
Story points:
-
Description
Unfortunately there seems to be a regression in the 2.7.2 release that wasn't caught by our tests.
What seems to have happened is that the data type returned by the Python SDK when reading from Keep changed to avoid copying a buffer (as an optimization), but the methods available on the new type are slightly different. Specifically throwing an exception on the call to "decode()":
if "cwl.output.json" in outc: with outc.open("cwl.output.json", "rb") as f: if f.size() > 0: outputs = json.loads(f.read().decode())
Updated by Peter Amstutz 26 days ago
- Description updated (diff)
- Subject changed from regression calling encode() on memoryview returned by ArvFile to regression calling decode() on memoryview returned by ArvFile
Updated by Claudio Lorenzi 18 days ago
Hi!
If it can help, here https://github.com/K0lb3/UnityPy/pull/24/files#diff-6251546231e080376d5bd106e7470c7bde8a672c4af32703fd362b239857eebe they solved by adding a check before the decoding. In this case it would be something like:
if "cwl.output.json" in outc:
with outc.open("cwl.output.json", "rb") as f:
if f.size() > 0:
out_bytes = f.read()
if isinstance(name, memoryview):
out_bytes = name.tobytes()
outputs = json.loads(out_bytes.decode())
Updated by Peter Amstutz 12 days ago
- Target version changed from Development 2024-05-08 sprint to Development 2024-05-22 sprint
Actions