Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

UnicodeDecodeError on fastboot.Download(filename) #145

@FT-Liang

Description

@FT-Liang

Hi,
I've encountered the following exception on running fastboot.Download(filename) with python 3.6:

Traceback (most recent call last):
  File "python-adb/adb/fastboot.py", line 326, in Download
    source_file, source_len, info_cb, progress_callback=progress_callback)
  File "python-adb/adb/fastboot.py", line 137, in HandleDataSending
    self._Write(source_file, accepted_size, progress_callback)
  File "python-adb/adb/fastboot.py", line 195, in _Write
    tmp = data.read(self.chunk_kb * 1024)
  File "/usr/lib/python3.6/codecs.py", line 321, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9b in position 7: invalid start byte

Changing source_file = open(source_file) to source_file = open(source_file, mode='rb') fix the problem, not sure if this is really a bug or by-design though.

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