PyBaiduYuyin icon indicating copy to clipboard operation
PyBaiduYuyin copied to clipboard

python3 下的Bug

Open onsunsl opened this issue 7 years ago • 0 comments

C:\Anaconda3\python.exe D:/AnyCode/python/Robot3D/BaiduVoiceAPI_Python-master/baidu.py Traceback (most recent call last): File "D:/AnyCode/python/Robot3D/BaiduVoiceAPI_Python-master/baidu.py", line 463, in t = TTS() File "D:/AnyCode/python/Robot3D/BaiduVoiceAPI_Python-master/baidu.py", line 149, in init self.token = GetToken(self.app_key, self.secret_key) File "D:/AnyCode/python/Robot3D/BaiduVoiceAPI_Python-master/baidu.py", line 26, in GetToken response = urlopen("https://openapi.baidu.com/oauth/2.0/token", data=urlencode(data)) File "C:\Anaconda3\lib\urllib\request.py", line 161, in urlopen return opener.open(url, data, timeout) File "C:\Anaconda3\lib\urllib\request.py", line 461, in open req = meth(req) File "C:\Anaconda3\lib\urllib\request.py", line 1112, in do_request_ raise TypeError(msg) TypeError: POST data should be bytes or an iterable of bytes. It cannot be of type str.

Process finished with exit code 1

onsunsl avatar Mar 10 '17 11:03 onsunsl