Skip to content

Pub/Sub: System test failures on Python 2.7 (invalid syntax) #7841

Closed

Description

@tswast

https://source.cloud.google.com/results/invocations/e8706e96-9a37-40d5-8411-7cd62206b4aa/targets/cloud-devrel%2Fclient-libraries%2Fgoogle-cloud-python%2Fpresubmit%2Fpubsub/log

tests/unit/pubsub_v1/subscriber/test_subscriber_client.py:18: in <module>
    from google.cloud.pubsub_v1 import subscriber
google/cloud/pubsub_v1/__init__.py:19: in <module>
    from google.cloud.pubsub_v1 import subscriber
google/cloud/pubsub_v1/subscriber/__init__.py:17: in <module>
    from google.cloud.pubsub_v1.subscriber.client import Client
google/cloud/pubsub_v1/subscriber/client.py:30: in <module>
    from google.cloud.pubsub_v1.subscriber._protocol import streaming_pull_manager
E     File "/tmpfs/src/github/google-cloud-python/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py", line 198
E       print(f"{messages_percent}, {bytes_percent}")
E                                                  ^
E   SyntaxError: invalid syntax

Looks like streaming_pull_manager.py is using a format string, which isn't valid Python 2.7 syntax. Needs to use "{}, {}".format(...), instead.

Activity

  1. added
    type: bug
    api: pubsub
    on May 1, 2019
  2. plamut commented on May 1, 2019

    @plamut
    Contributor

    How did that end up in the codebase, didn't the tests catch this before merging?

    Anyhow, will have a look at it tomorrow, should be an easy fix. Thanks for bringing it up!

  3. plamut commented on May 1, 2019

    @plamut
    Contributor

    Found the commit that brought this in.

    What are all those print() calls in streaming_pull_manager.py for anyway? They seem like some debugging leftovers to me...

  4. anguillanneuf commented on May 1, 2019

    @anguillanneuf
    Contributor

    I confirm those are bebugging leftover. They are safe to remove/reverted to what's there before. I was just noticing this one too and commented on the commit.

  5. sduskis commented on May 2, 2019

    @sduskis
    Contributor

    Thanks for taking care of this, @tswast, @anguillanneuf and @plamut

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

Metadata

Metadata

Labels

api: pubsubtestingtype: bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions