LINE icon indicating copy to clipboard operation
LINE copied to clipboard

TypeError: 'unicode' does not have the buffer interface

Open gamefan opened this issue 7 years ago • 0 comments

I can not login

Traceback (most recent call last):
  File "C:\MyData\TTT\LINE-master\echobot.py", line 5, in <module>
    client = LineClient("ID", "PS")
  File "C:\MyData\TTT\LINE-master\line\client.py", line 88, in __init__
    self.login()
  File "C:\MyData\TTT\LINE-master\line\api.py", line 124, in login
    self.com_name, self.provider, self.certificate)
  File "C:\Python27\lib\site-packages\curve\CurveThrift.py", line 343, in loginWithIdentityCredentialForCertificate
    self.send_loginWithIdentityCredentialForCertificate(identifier, password, keyname, crypto, keepLoggedIn, accessLocation, systemName, identityProvider, certificate)
  File "C:\Python27\lib\site-packages\curve\CurveThrift.py", line 358, in send_loginWithIdentityCredentialForCertificate
    args.write(self._oprot)
  File "C:\Python27\lib\site-packages\curve\CurveThrift.py", line 2424, in write
    oprot.writeString(self.keyname)
  File "C:\Python27\lib\site-packages\thrift\protocol\TProtocol.py", line 121, in writeString
    self.writeBinary(str_to_binary(str_val))
  File "C:\Python27\lib\site-packages\thrift\protocol\TCompactProtocol.py", line 42, in nested
    return func(self, *args, **kwargs)
  File "C:\Python27\lib\site-packages\thrift\protocol\TCompactProtocol.py", line 272, in __writeBinary
    self.trans.write(s)
  File "C:\Python27\lib\site-packages\thrift\transport\THttpClient.py", line 134, in write
    self.__wbuf.write(buf)
TypeError: 'unicode' does not have the buffer interface
1112

I had done. #93

change LINE_DOMAIN from http to https LINE_DOMAIN = "https://gd2.line.naver.jp"

in client.py disable self._headers['X-Line-Application']=app then in api.py in def login(self):

j = self.get_json(self.LINE_CERTIFICATE_URL)

add: self._headers['X-Line-Application']=app self.transport.setCustomHeaders(self._headers)

but it can not work.

gamefan avatar Jul 30 '17 10:07 gamefan