xybu / onedrived-dev

A Microsoft OneDrive client for Linux, written in Python3.
https://github.com/xybu/onedrived-dev
MIT License
705 stars 78 forks source link

TypeError: a bytes-like object is required, not 'list' #124

Open sudheerExperiments opened 5 years ago

sudheerExperiments commented 5 years ago

Onedrived fails to get onedrive folder information.

I encountered this error when running the below commands.

onedrived-pref drive list

and

onedrived start

Seems like the issue is with openssl library. The library is expecting a byte string, while the onedrive API is returning an encrypted list of integer data.

The problem can be resolved by typecasting the list of integers data to a bytes object.

Make the below change to line 140 in 'cryptography/hazmat/backends/openssl/ciphers.py' file as follows.

Before:

self._backend._ffi.from_buffer(data), len(data)

After:

self._backend._ffi.from_buffer(bytes(data)), len(data)

It should solve the problem. Onedrived commands should work.