streaming_client classes do not properly interpret short reads in source streams · Issue #24 · aws/aws-encryption-sdk-python (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

@mattsb42-aws

Description

@mattsb42-aws

Problem

Per PEP 3116:

.read(n: int) -> bytes

Read up to n bytes from the object and return them. Fewer than n bytes may be
returned if the operating system call returns fewer than n bytes. If 0 bytes are
returned, this indicates end of file. If the object is in non-blocking mode and no
bytes are available, the call returns None.

The current behavior of the clients in streaming_clients is to interpret reads returning fewer than n bytes as OEF.

Solution

Update clients to properly handle short reads per PEP 3116.