aws : C:\Program Files\Amazon\AWSCLI\.\dateutil\parser.py:428: UnicodeWarning


 


EC2のWindows環境を作っているのですが、AWS CLI実行時にUnicodeのWarningが出るのなんとかしてもらえませんかねえ。


aws : C:\Program Files\Amazon\AWSCLI\.\dateutil\parser.py:428: UnicodeWarning:
Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
At C:\Data\bin\win_dir_sync_to_s3.ps1:26 char:1
+ aws s3 sync --delete C:\Data\Work s3://hoge/to/folder
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (C:\Program File...s being unequal
:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError

 
先人の知恵を借り、対応としてPythonのpin経由でのインストールを行う。

先ずは「AWS Command Line Interface」をアンインストール。

Pythonの最新版をインストール。現時点では以下のURLからWindows x86-64 executable installerをダウンロード。
https://www.python.org/downloads/release/python-351/

Pythonインストール時に、”Add Python 3.5 to PATH”にチェックを入れ、”Install Now”。

 
直って、PowerShellで作ったシェル内で、AWS CLIのコマンドが正常終了するようになった。

EC2の環境構築時にいちいち手動でPythonインストール⇒pipはめんどくさいので、User Dataで自動化するようにできないかなあ。

 

Windows PowerShell 実践システム管理ガイド2版 (TechNet ITプロシリーズ)
Inc.(横田 秀之) Yokota Lab 河野 憲義
日経BP社
売り上げランキング: 105,766

関連記事