从p12文件读取数据时出现UnicodeDecodeError

时间:2016-02-23 14:11:41

标签: python google-api-python-client oauth2client

代码在2.6本地工作,但是当我在服务器上部署相同的代码时,从邮件下载代码然后在服务器上部署代码时会出现以下错误:

File "/usr/lib/python2.6/site-packages/oauth2client/service_account.py", line 276, in from_p12_keyfile private_key_password=private_key_password, scopes=scopes)
File "/usr/lib/python2.6/site-packages/oauth2client/service_account.py", line 244, in _from_p12_keyfile_contents private_key_password) 
File "/usr/lib/python2.6/site-packages/oauth2client/_pure_python_crypt.py", line 167, in from_string key = _from_bytes(key) # pem expects str in Py3 
File "/usr/lib/python2.6/site-packages/oauth2client/_helpers.py", line 87, in _from_bytes if isinstance(value, six.binary_type) else value) 
File "/usr/lib64/python2.6/encodings/utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) 
UnicodeDecodeError: 'utf8' codec can't decode byte 0x82 in position 1: invalid start byte

0 个答案:

没有答案