Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Blob.upload_from_file doesn't work for file-like objects without size parameter #900

Copy link
Copy link
@theacodes

Description

@theacodes
Issue body actions

When using StringIO, io.BytesIO or other file-like objects (such as Flask/werkzeug's file upload object), trying to upload via Blob.upload_from_file doesn't work because it attempts to find the size of the object using os.stat throwing a AttributeError: StringIO instance has no attribute 'fileno'. Passing in the size manually fixes this, but imo this inconsistency shouldn't burden the user as there are other ways than fileno to determine the size of a StringIO or io.BytesIO instance (seek, tell).

At any rate, the error message could be more helpful.

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.