【问题标题】:How to avoid warning message in Windows AWS CLI S3如何避免 Windows AWS CLI S3 中的警告消息
【发布时间】:2019-04-05 08:28:36
【问题描述】:

我们在下面上传 S3 时收到警告消息。它根本没有害处,但如果可能的话,我们希望能够抑制。

-- 警告信息

C:\Program Files\Amazon\AWSCLI\.\dateutil\parser\_parser.py:1175: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal

-- 实际情况

   c:\temp>aws s3 ls s3://s3-dwh-XXXXX/s3-dwh-backup-exp/
    C:\Program Files\Amazon\AWSCLI\.\dateutil\parser\_parser.py:1175: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
    2018-11-01 10:10:49          0
    2018-11-01 10:06:53  132872957 DL_CustMstNEW_01.gz
    2018-11-01 10:06:58   41152747 DL_CustMstNEW_02.gz
    2018-11-01 10:07:04   43736036 DL_CustMstNEW_03.gz
    2018-11-01 10:07:07   42409294 DL_CustMstNEW_04.gz
    2018-11-01 10:07:11   39195854 DL_CustMstNEW_05.gz
    2018-11-01 10:07:15   37022918 DL_CustMstNEW_06.gz
    2018-11-01 10:07:19   40475266 DL_CustMstNEW_07.gz
    2018-11-01 10:07:23   40827113 DL_CustMstNEW_08.gz
    2018-11-01 10:07:27   40064518 DL_CustMstNEW_09.gz
    2018-11-01 10:07:31   40103445 DL_CustMstNEW_10.gz
    2018-11-01 10:07:36   38343333 DL_CustMstNEW_11.gz
    2018-11-01 10:07:40   38345654 DL_CustMstNEW_12.gz

    c:\temp>aws s3 ls s3://s3-dwh-XXXXX/s3-dwh-backup-exp/

|查找 /c /v "" C:\Program Files\Amazon\AWSCLI.\dateutil\parser_parser.py:1175:UnicodeWarning:Unicode 相等比较未能将两个参数都转换为 Unicode - 将它们解释为不相等 13

也许我们有任何编码或模块问题,这是我们的 AWS CLI 版本。

c:\temp>aws --version
aws-cli/1.16.10 Python/2.7.9 Windows/2012Server botocore/1.12.0

如果您知道任何解决方案,请告诉我。

提前谢谢你。

【问题讨论】:

    标签: python amazon-s3 aws-cli


    【解决方案1】:

    这种情况,可以在powershell中设置变量

    Set-Item env:tz -Value your-timezone 
    

    举例

    Set-Item env:tz -Value UTC+1
    

    【讨论】:

    • 欢迎来到stackoverflow @Guilhermearv,请附上您提供解释的代码以支持您的回答。
    • 非常非常感谢@Guilhermearv!很抱歉我迟到的回复,因为我直到现在才注意到你的评论。我尝试了 UTC+9 并确认可以按预期避免警告消息,非常感谢!!
    猜你喜欢
    • 1970-01-01
    • 2016-12-25
    • 2021-02-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-29
    • 1970-01-01
    • 2019-02-21
    相关资源
    最近更新 更多