Error when b2 writes non-ASCII to stdout

Aberta
#71 5 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
35/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Estagnada
Stack de tecnologia
python
Domínio
cli

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
Python
Estrelas
214
Forks
68
Merge médio
51min
PRs com merge (30d)
6

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de Backblaze/b2-sdk-python

Todas as issues de Backblaze/b2-sdk-python

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.