TypeError: 'unicode' does not have the buffer interface
- Dominant language
- Python
- Stars
- 827
- Forks
- 189
- PR merge metrics
- No merged PRs in 30d
Description
I can not login
```
Traceback (most recent call last):
File "C:\MyData\TTT\LINE-master\echobot.py", line 5, in
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
```

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.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with line/client.py and line/api.py, especially LineClient.__init__ and login(), then follow the traceback through thrift's TProtocol, TCompactProtocol, and THttpClient. Reproduce the failure from echobot.py using the shown Python 2.7 setup and inspect the certificate request and custom-header changes. Done means login completes without the unicode buffer-interface error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, authentication, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100