Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
githubwua opened this issue Aug 27, 2024 · 2 comments
Assignees
Labels
api: pubsub Issues related to the googleapis/python-pubsub API.

Comments

@githubwua
Copy link

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.

@product-auto-label product-auto-label bot added the api: pubsub Issues related to the googleapis/python-pubsub API. label Aug 27, 2024
githubwua added a commit to githubwua/python-pubsub that referenced this issue Aug 27, 2024
@mukund-ananthu
Copy link
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.

@githubwua
Copy link
Author

githubwua commented Sep 2, 2024

The proper fix: #1244

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the googleapis/python-pubsub API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
@githubwua @mukund-ananthu and others