Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #14300
Closed
Open
Issue created Dec 20, 2022 by Administrator@rootContributor

[REQ] Python file_type streaming upload

Created by: skinkie

Is your feature request related to a problem? Please describe.

When using a large file, python's requests will serialise this to memory. If the form rendering is bigger than the available memory, this will fail.

Describe the solution you'd like

Analogue to https://pypi.org/project/requests-toolbelt/ a way where file like objects offered via a "open(..., 'rb')" or "open(..., 'rb', buffered=0)" interface are never encoded to a body prior to sending.

Describe alternatives you've considered

I was hoping it worked out of the box.

This is my guess that describes the actual problem, it materialises the file contents.

    def get_file_data_and_close_file(file_instance: io.IOBase) -> bytes:
        file_data = file_instance.read()
        file_instance.close()
        return file_data

Urllib3 upstream multipart streaming support. https://github.com/urllib3/urllib3/pull/2331

Assignee
Assign to
Time tracking