Skip to content

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

@benijaichenco

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'

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