iterative / iterative/PyDrive2

fs.cp_file: out of memory error (don't store file in RAM)

Open
#138 6 comments 0 reactions 0 assignees View on GitHub
fs optimization priority-p2
Dominant language
Python
Stars
670
Forks
75
PR merge metrics
No merged PRs in 30d

Description

https://github.com/iterative/PyDrive2/blob/378c6e80471d44f4164e64a178efc2f06ecae882/pydrive2/fs/spec.py#L358-L365

ref. https://github.com/iterative/PyDrive2/pull/119#pullrequestreview-753066960 suggestion:

> ```diff
> - """In-memory streamed copy"""
> - with self.open(lpath) as stream:
> - # IterStream objects doesn't support full-length
> - # seek() calls, so we have to wrap the data with
> - # an external buffer.
> - buffer = io.BytesIO(stream.read())
> - self.upload_fobj(buffer, rpath)
> + with self.open(lpath) as stream:
> + self.upload_fobj(stream, rpath)
> ```
>
> and fix `self.open` to return a proper stream.

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.