Skip to content
This repository was archived by the owner on May 6, 2026. It is now read-only.
This repository was archived by the owner on May 6, 2026. It is now read-only.

_GzipDecoder.decompress() TypeError: unexpected keyword argument 'max_length' #491

Closed

Description

@benijaichenco

Environment details

  • OS type and version: Windows 10/11, macOS
  • Python version: Python 3.8.x or higher
  • pip version: 25.3
  • google-resumable-media version: 2.8.0

Steps to reproduce

  1. Import the custom decoder class: _GzipDecoder from google.resumable_media.requests.download.

  2. Call the decompress() method on the instance, passing the max_length=1024 keyword argument.

  3. The script fails, throwing a TypeError because the unpatched method signature does not accept the max_length argument.

Code example

from google.resumable_media.requests.download import _GzipDecoder

# Instantiate the decoder.
decoder = _GzipDecoder()

# Try calling the decompress method with the unexpected 'max_length' argument.
# This simulates the call made by urllib3 v2.6+
print("Attempting to call decoder.decompress(data, max_length=1024)...")

# The bug causes this line to immediately raise a TypeError
decoder.decompress(b"", max_length=1024) 

print("Test passed (Bug not reproduced).")
# If the code reaches this point, the fix is in place or urllib3 is too old.

Stack trace

_GzipDecoder.decompress() got an unexpected keyword argument 'max_length'

Activity

  1. added
    api: storageIssues related to the googleapis/google-resumable-media-python API.
    on Dec 7, 2025
  2. added 2 commits that reference this issue on Jan 28, 2026
    11c51a5
    2aa67b2
  3. added a commit that references this issue on Feb 26, 2026
    c74b95f
  4. adam-sikora commented on Mar 2, 2026

    @adam-sikora

    @chalmerlowe is there a plan to release a new version with this fix?

  5. chalmerlowe commented on Mar 2, 2026

    @chalmerlowe
    Contributor

    @adam-sikora a fix was merged to main four days ago.
    #495

    It will go out with the next release. I do not have a time/date for when the next release will be, yet, but it is definitely on my radar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the googleapis/google-resumable-media-python API.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions