Skip to content

'utf-8' codec can't decode #1365

Open
Open

Description

@Doubleuncle

There is an error reading stdout if contains any line with non utf-8 characters.
I wanna get the all thing about the path(uid,size,permission……),and the files contains utf-8,gbk, ansi characters.When i use 'stdout.readlines()' it always except error " 'utf-8' codec can't decode……“

stdin, stdout, stderr = client.exec_command('ls -al')
res_list = stdout.readlines()

So has anyone encountered such problem can tell how to solve it?

Activity

  1. martinloiseau commented on Jun 22, 2021

    @martinloiseau

    Smae issue here, did you find any fix?

  2. hakaishi commented on Mar 14, 2022

    @hakaishi

    Fix in progress. Pull request at #1995

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions