Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

SyntaxError: referred httplib2 is not Python 3 compatible #277

Closed
tux21b opened this issue Dec 28, 2017 · 7 comments
Closed

SyntaxError: referred httplib2 is not Python 3 compatible #277

tux21b opened this issue Dec 28, 2017 · 7 comments

Comments

@tux21b
Copy link

tux21b commented Dec 28, 2017

I can build single layers using the container_image rule, but when I try to generate a full image, I get the following error:

Traceback (most recent call last):
  File "/home/christoph/.cache/bazel/_bazel_christoph/220ce0b38b5e050194382cdf4603ff6e/bazel-sandbox/4139697691902310841/execroot/XXX/bazel-out/host/bin/external/io_bazel_rules_docker/container/join_layers.runfiles/at_mgit_mmdsearch/../io_bazel_rules_docker/container/join_layers.py", line 27, in <module>
    from containerregistry.client import docker_name
  File "/home/christoph/.cache/bazel/_bazel_christoph/220ce0b38b5e050194382cdf4603ff6e/bazel-sandbox/4139697691902310841/execroot/XXX/bazel-out/host/bin/external/io_bazel_rules_docker/container/join_layers.runfiles/containerregistry/client/__init__.py", line 23, in <module>
    from containerregistry.client import docker_creds_
  File "/home/christoph/.cache/bazel/_bazel_christoph/220ce0b38b5e050194382cdf4603ff6e/bazel-sandbox/4139697691902310841/execroot/XXX/bazel-out/host/bin/external/io_bazel_rules_docker/container/join_layers.runfiles/containerregistry/client/docker_creds_.py", line 27, in <module>
    import httplib2
  File "/home/christoph/.cache/bazel/_bazel_christoph/220ce0b38b5e050194382cdf4603ff6e/bazel-sandbox/4139697691902310841/execroot/XXX/bazel-out/host/bin/external/io_bazel_rules_docker/container/join_layers.runfiles/httplib2/__init__.py", line 942
    print "connect: (%s, %s) ************" % (self.host, self.port)
                                         ^
SyntaxError: invalid syntax

It looks like the referred httplib module in https://github.com/bazelbuild/rules_docker/blob/master/container/container.bzl#L67 isn't Python3 compatible.

@mattmoor
Copy link
Contributor

Yes, I believe there is another issue from @hwright tracking this.

@hwright
Copy link
Contributor

hwright commented Dec 28, 2017

That would be google/containerregistry#42

@mattmoor
Copy link
Contributor

thanks. We can certainly reduce the number of places we import this (even within the library). cc @dekkagaijin

@tux21b
Copy link
Author

tux21b commented Dec 28, 2017

Ah, thanks for the fast reply and sorry for the duplicate. I haven't seen the other issue before.

@tux21b tux21b closed this as completed Dec 28, 2017
@MarkusTeufelberger
Copy link

Local issue in this repo: #260

@hwright
Copy link
Contributor

hwright commented Dec 28, 2017

@MarkusTeufelberger Correct. #260 is the same problem, but for code in this repository (it looks like it was lifted from google/containerregistry). I wanted to be sure if we fixed it in one place, it got fixed elsewhere.

@dekkagaijin
Copy link
Contributor

@mattmoor ACK

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants