GoogleCloudPlatform / cloud-sdk-docker

Google Cloud CLI Docker Image - Docker Image containing the gcloud CLI and its bundled components.
https://cloud.google.com/sdk/docs/downloads-docker
Apache License 2.0
746 stars 233 forks source link

`gsutil` produces Python errors in `google/cloud-sdk:486.0.0-alpine` #451

Closed c-lewis closed 3 months ago

c-lewis commented 4 months ago
1e349218ecd3:/$ gsutil --version
/google-cloud-sdk/platform/gsutil/gslib/vendored/boto/boto/__init__.py:1105: SyntaxWarning: invalid escape sequence '\c'
  """
/google-cloud-sdk/platform/gsutil/gslib/vendored/boto/boto/pyami/config.py:98: SyntaxWarning: invalid escape sequence '\s'
  match = re.match("^#import[\s\t]*([^\s^\t]*)[\s\t]*$", line)
/google-cloud-sdk/platform/gsutil/third_party/pyasn1/pyasn1/type/constraint.py:100: SyntaxWarning: invalid escape sequence '\*'
  """Create a SingleValueConstraint object.
/google-cloud-sdk/platform/gsutil/third_party/pyasn1/pyasn1/type/constraint.py:141: SyntaxWarning: invalid escape sequence '\*'
  """Create a ContainedSubtypeConstraint object.
/google-cloud-sdk/platform/gsutil/third_party/pyasn1/pyasn1/type/constraint.py:301: SyntaxWarning: invalid escape sequence '\*'
  """Create a PermittedAlphabetConstraint object.
/google-cloud-sdk/platform/gsutil/third_party/pyasn1/pyasn1/type/constraint.py:457: SyntaxWarning: invalid escape sequence '\*'
  """Create a ConstraintsIntersection logic operator object.
/google-cloud-sdk/platform/gsutil/third_party/pyasn1/pyasn1/type/constraint.py:501: SyntaxWarning: invalid escape sequence '\*'
  """Create a ConstraintsUnion logic operator object.
/google-cloud-sdk/platform/gsutil/third_party/pyasn1/pyasn1/type/namedval.py:15: SyntaxWarning: invalid escape sequence '\*'
  """Create named values object.
/google-cloud-sdk/platform/gsutil/gslib/vendored/boto/boto/connection.py:672: SyntaxWarning: invalid escape sequence '\w'
  '(?:(?P<user>[\w\-\.]+):(?P<pass>.*)@)?'
/google-cloud-sdk/platform/gsutil/gslib/vendored/boto/boto/connection.py:673: SyntaxWarning: invalid escape sequence '\w'
  '(?P<host>[\w\-\.]+)'
/google-cloud-sdk/platform/gsutil/gslib/vendored/boto/boto/connection.py:674: SyntaxWarning: invalid escape sequence '\d'
  '(?::(?P<port>\d+))?'
/google-cloud-sdk/platform/gsutil/gslib/vendored/boto/boto/connection.py:1121: SyntaxWarning: invalid escape sequence '\.'
  'specific endpoint this request was sent to\.'
/google-cloud-sdk/platform/gsutil/gslib/vendored/boto/boto/https_connection.py:80: SyntaxWarning: invalid escape sequence '\.'
  host_re = host.replace('.', '\.').replace('*', '[^.]*')
gsutil version: 5.30
andrewmackett commented 3 months ago

I'm also seeing this error when using the gcr.io/google.com/cloudsdktool/google-cloud-cli:alpine container.

The last version without the error is 478.0.0.

docker run --rm gcr.io/google.com/cloudsdktool/google-cloud-cli:478.0.0-alpine gsutil --version
gsutil version: 5.29

Version 479.0.0 and newer show the error.

docker run --rm gcr.io/google.com/cloudsdktool/google-cloud-cli:479.0.0-alpine gsutil --version
/google-cloud-sdk/platform/gsutil/gslib/vendored/boto/boto/__init__.py:1105: SyntaxWarning: invalid escape sequence '\c'
  """
/google-cloud-sdk/platform/gsutil/gslib/vendored/boto/boto/pyami/config.py:98: SyntaxWarning: invalid escape sequence '\s'
  match = re.match("^#import[\s\t]*([^\s^\t]*)[\s\t]*$", line)
/google-cloud-sdk/platform/gsutil/third_party/pyasn1/pyasn1/type/constraint.py:100: SyntaxWarning: invalid escape sequence '\*'
  """Create a SingleValueConstraint object.
/google-cloud-sdk/platform/gsutil/third_party/pyasn1/pyasn1/type/constraint.py:141: SyntaxWarning: invalid escape sequence '\*'
  """Create a ContainedSubtypeConstraint object.
/google-cloud-sdk/platform/gsutil/third_party/pyasn1/pyasn1/type/constraint.py:301: SyntaxWarning: invalid escape sequence '\*'
  """Create a PermittedAlphabetConstraint object.
/google-cloud-sdk/platform/gsutil/third_party/pyasn1/pyasn1/type/constraint.py:457: SyntaxWarning: invalid escape sequence '\*'
  """Create a ConstraintsIntersection logic operator object.
/google-cloud-sdk/platform/gsutil/third_party/pyasn1/pyasn1/type/constraint.py:501: SyntaxWarning: invalid escape sequence '\*'
  """Create a ConstraintsUnion logic operator object.
/google-cloud-sdk/platform/gsutil/third_party/pyasn1/pyasn1/type/namedval.py:15: SyntaxWarning: invalid escape sequence '\*'
  """Create named values object.
/google-cloud-sdk/platform/gsutil/gslib/vendored/boto/boto/connection.py:672: SyntaxWarning: invalid escape sequence '\w'
  '(?:(?P<user>[\w\-\.]+):(?P<pass>.*)@)?'
/google-cloud-sdk/platform/gsutil/gslib/vendored/boto/boto/connection.py:673: SyntaxWarning: invalid escape sequence '\w'
  '(?P<host>[\w\-\.]+)'
/google-cloud-sdk/platform/gsutil/gslib/vendored/boto/boto/connection.py:674: SyntaxWarning: invalid escape sequence '\d'
  '(?::(?P<port>\d+))?'
/google-cloud-sdk/platform/gsutil/gslib/vendored/boto/boto/connection.py:1121: SyntaxWarning: invalid escape sequence '\.'
  'specific endpoint this request was sent to\.'
/google-cloud-sdk/platform/gsutil/gslib/vendored/boto/boto/https_connection.py:80: SyntaxWarning: invalid escape sequence '\.'
  host_re = host.replace('.', '\.').replace('*', '[^.]*')
gsutil version: 5.29
frdvo commented 3 months ago

Same issue for 487

murican commented 3 months ago

Yep same with google/cloud-sdk:487.0.0-alpine and gsutil version: 5.30

cloudsdkdocker commented 3 months ago

Fixed in: https://github.com/GoogleCloudPlatform/cloud-sdk-docker/commit/c6878f579996a6eaa51007492738f6181df695db

Alpine will be upgraded to 3.20 once the incompatibility is addressed.