Error when b2 writes non-ASCII to stdout

オープン
#71 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
cli

調査の方向性

The warning is emitted by the b2sdk.sync.report logger when a sync line cannot be written to stdout. Start in that module's output path and find where stdout is written and which encoding it uses under a redirected, non-UTF-8 locale. Reproduce by running a sync with LANG=C and stdout redirected to a file, using a filename containing non-ASCII characters. Done means that output is written without the warning, or the encoding is handled explicitly. Check the existing sync reporting tests first, since this issue has gone unanswered for years and may have changed upstream.

索引モデルが issue の本文から書いたものです。

説明

The command

b2 sync --noProgress --keepDays 14 /home/data/v2 b2://backup/ > /path/to/logfile

produced this error on stderr.

WARNING:b2sdk.sync.report:could not output the following line with encoding None on stdout due 
to 'ascii' codec can't encode character u'\xfa' in position 40: ordinal not in range(128): 
upload files/Playlist-for-Derecho-a-la-música-9-15-19.csv

I think this is not my fault as a user of the b2 command.

If b2 uses ASCII on stdout then it should take care to not send any non-ASCII characters to stdout to avoid this python error.

Better than that is to use UTF-8 for stdout, at least when it is not connected to a term.

主要言語
Python
スター
214
フォーク
68
平均マージ
51分
マージ済み PR(30日)
6

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Backblaze/b2-sdk-python のほかの issue

Backblaze/b2-sdk-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。