Project

General

Profile

Actions

Bug #21718

open

regression calling decode() on memoryview returned by ArvFile

Added by Peter Amstutz 26 days ago. Updated 11 days ago.

Status:
In Progress
Priority:
Normal
Assigned To:
Category:
CWL
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())

Subtasks 1 (1 open0 closed)

Task #21727: ReviewNewTom CleggActions
Actions #1

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
Actions #2

Updated by Peter Amstutz 25 days ago

  • Assigned To set to Peter Amstutz
Actions #5

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())

Actions #6

Updated by Peter Amstutz 12 days ago

  • Status changed from New to In Progress
Actions #7

Updated by Peter Amstutz 12 days ago

  • Target version changed from Development 2024-05-08 sprint to Development 2024-05-22 sprint
Actions

Also available in: Atom PDF