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

streaming_pull_manager.py throws TypeError: object of type 'NoneType' has no len() #1238

Closed

Description

@githubwua

Error exception:

File "/usr/local/lib/python3.10/site-packages/google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py", line 944, in _shutdown

 total = len(dropped_messages) + len(

 TypeError: object of type 'NoneType' has no len()

Thrown by this code:

https://github.com/googleapis/python-pubsub/blame/7cf2d11ce20bf9080c4434b920bdf419faac5d88/google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py#L944

We should add a check to ensure dropped_messages is not None.

Activity

  1. mukund-ananthu commented on Aug 28, 2024

    @mukund-ananthu
    Contributor

    @githubwua The fix you provide will not help address this issue(whose existence in the latest version of the library is yet to be verified). This is because dropped_messages would be a list(empty or otherwise), and hence a len() on it should not result in an error.

  2. githubwua commented on Sep 2, 2024

    @githubwua
    Author

    The proper fix: #1244

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

Metadata

Metadata

Labels

api: pubsubIssues related to the googleapis/python-pubsub API.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions