【问题标题】:s3cmd incomplete format errors3cmd 不完整的格式错误
【发布时间】:2013-05-12 21:39:29
【问题描述】:

当我跑步时

$ s3cmd

我明白了

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    An unexpected error has occurred.
  Please report the following lines to:
   s3tools-bugs@lists.sourceforge.net
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Problem: ValueError: incomplete format
S3cmd:   1.0.1

Traceback (most recent call last):
  File "/usr/bin/s3cmd", line 2006, in <module>
    main()
  File "/usr/bin/s3cmd", line 1795, in main
    cfg = Config(options.config)
  File "/usr/lib/python2.7/site-packages/S3/Config.py", line 88, in __init__
    self.read_config_file(configfile)
  File "/usr/lib/python2.7/site-packages/S3/Config.py", line 105, in read_config_file
    cp = ConfigParser(configfile)
  File "/usr/lib/python2.7/site-packages/S3/Config.py", line 142, in __init__
    self.parse_file(file, sections)
  File "/usr/lib/python2.7/site-packages/S3/Config.py", line 170, in parse_file
    print_value = (data["value"][:2]+"...%d_chars..."+data["value"][-1:]) % (len(data["value"]) - 3)
ValueError: incomplete format

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    An unexpected error has occurred.
    Please report the above lines to:
   s3tools-bugs@lists.sourceforge.net
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

任何人有什么想法吗??

【问题讨论】:

  • 最初我认为这是由于 Fedora 中的 python 更新(在 Ubuntu 中相同)...但这是由于使用特殊字符设置密码

标签: python-2.7 s3cmd


【解决方案1】:

我发现问题出在哪里了。

我正在通过 s3cmd --config 配置 s3cmd

s3cmd 要求我为 GPG 设置加密密码/密码

$ s3cmd --configure
...
Encryption password is used to protect your files from reading
by unauthorized persons while in transfer to S3
Encryption password 

我设置了非常强大的密码,包括非 A-Z 字符(如 %)。 s3cmd --configure 没有转义这些字符,因此我的配置文件是这样生成的:

cat ~/.s3cfg
...
gpg_passphrase = examplepassword123%%
...

如果其他人有这种问题:要解决这个问题,请删除 s3cmd 配置文件并再次运行配置并设置密码/密码,仅使用 a-z A-Z 0-9 字符

 rm ~/.s3cfg
 s3cmd --configure

【讨论】:

  • 非常感谢!删除 ~/.s3cfg 是解决方案
  • :) 很高兴它对你有所帮助
猜你喜欢
  • 1970-01-01
  • 2014-01-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-04-08
  • 2021-04-26
相关资源
最近更新 更多