小弟在自己的 Ubuntu 執行的時候試沒問題的
但是到正式環境的時候執行會看到下面這段錯誤
Traceback (most recent call last):
File "news.py", line 98, in <module>
_ReptileNewsWin007("http://yahoo.com.tw/")
File "news.py", line 59, in _ReptileNewsWin007
conn = pymysql.connect(host=sHost, port=sPort, user=sUser,
passwd=sPassWord, db=sDBName,use_unicode=True, charset="utf8")
File "/usr/lib/python2.6/site-packages/pymysql/__init__.py", line 90, in
Connect
return Connection(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/pymysql/connections.py", line 699,
in __init__
self.connect()
File "/usr/lib/python2.6/site-packages/pymysql/connections.py", line 935,
in connect
self._get_server_information()
File "/usr/lib/python2.6/site-packages/pymysql/connections.py", line 1249,
in _get_server_information
packet = self._read_packet()
File "/usr/lib/python2.6/site-packages/pymysql/connections.py", line 991,
in _read_packet
packet_header = self._read_bytes(4)
File "/usr/lib/python2.6/site-packages/pymysql/connections.py", line 1025,
in _read_bytes
data = self._rfile.read(num_bytes)
File "/usr/lib64/python2.6/io.py", line 940, in read
return self._read_unlocked(n)
File "/usr/lib64/python2.6/io.py", line 974, in _read_unlocked
chunk = self.raw.read(wanted)
File "/usr/lib64/python2.6/io.py", line 591, in read
n = self.readinto(b)
File "/usr/lib/python2.6/site-packages/pymysql/_socketio.py", line 59, in
readinto
return self._sock.recv_into(b)
TypeError: recv_into() argument 1 must be pinned buffer, not bytearray
想請問各位先進是否知道這是為什麼產生錯誤?