GoogleCloudPlatform / GoogleCloudPlatform/gsutil

Issue with special character in the proxy password and gsutil commands

Open
#962 0 comments 4 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
918
Forks
335
PR merge metrics
No merged PRs in 30d

Description

Hi there,

I have GCP SDK installed (including gsutil) on a Windows 10 Laptop. I have the latest version **279.0.0** installed. I am working behind a corporate proxy. I have all env variable setup:
- custom_ca_certs_file
- username
- password

gsutil is crashing when O have special character in the proxy password like "%":

```
gsutil ls
Traceback (most recent call last):
File "C:\Users\xxx\google-cloud-sdk\platform/gsutil\gsutil", line 21, in
gsutil.RunMain()
File "C:\Users\xxx\google-cloud-sdk\platform\gsutil\gsutil.py", line 124, in RunMain
sys.exit(gslib.__main__.main())
File "C:\Users\xxxx\google-cloud-sdk\platform\gsutil\gslib\__main__.py", line 349, in main
boto.config.set(opt_section, opt_name, opt_value)
File "C:\Users\xxx\google-cloud-sdk\platform\bundledpython\lib\ConfigParser.py", line 752, in set
"position %d" % (value, tmp_value.find('%')))
ValueError: invalid interpolation syntax in u'*****%*' at position 6"
```

I don't have any issue with spcecial character in proxy password when using GCP Python library. It seems that the issue is coming from ConfigParser class and it configuration. It seems that we can choose to extend for example path/env that start with % or $

My questions are the following:
which ConfigParser is defined for gsutil ? where can I find this file ?

- probably the easier is to kown which special character should not be used in the proxy
- passworkd since they have another meaning with ConfigParse

The above example was with python 2.7 (bundle prepred by GCP)but I saw the same issue with python 3.7

I my case the proxy setup is coming form GCP SDK (gcloud config set ...) and gcloud commands are working fine.

Thanks
Cheers
Fabien

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.