-
-
Notifications
You must be signed in to change notification settings - Fork 915
Closed
Labels
Description
Since version 2.0.2, s3cmd with Python 2.7 fails with this error, when using what comments in the code now refer to as the "deprecated credentials file format".
Invoked as: /tmp/s3cmd/bin/s3cmd ls s3://bucket/
Problem: AttributeError: ConfigParser instance has no attribute 'read_string'
S3cmd: 2.0.2
python: 2.7.15 (default, May 1 2018, 05:55:50)
[GCC 7.3.0]
environment LANG=en_US.UTF-8
Traceback (most recent call last):
File "/tmp/s3cmd/bin/s3cmd", line 3092, in <module>
rc = main()
File "/tmp/s3cmd/bin/s3cmd", line 2792, in main
cfg = Config(options.config, options.access_key, options.secret_key, options.access_token)
File "/tmp/s3cmd/local/lib/python2.7/site-packages/S3/Config.py", line 221, in __init__
self.aws_credential_file()
File "/tmp/s3cmd/local/lib/python2.7/site-packages/S3/Config.py", line 303, in aws_credential_file
config.read_string(config_string.decode('utf-8'))
AttributeError: ConfigParser instance has no attribute 'read_string'
The contents of the credentials file are just the following two lines
aws_access_key_id=xxxx
aws_secret_access_key=yyyy
Any one of the following workarounds fixes this bug:
- Add a
[default]header to the credentials file. pip install configparserto install the Python 3 compatible version of configparser.- Downgrade to s3cmd 2.0.1, where this all worked previously.
This regression was introduced with the changes in PR #966.