2006年02月23日 星期四 15:47
python,您好! 下面的程序: conn = httplib.HTTPConnection("XXX.XXX.XXX.XXX:8009") conn.request("POST", "/", xmlquery) 出现错误: File "mobilereg.py", line 48, in AofaReg conn.request("POST", "/", xmlquery) File "/usr/local/lib/python2.4/httplib.py", line 800, in request self._send_request(method, url, body, headers) File "/usr/local/lib/python2.4/httplib.py", line 817, in _send_request self.putrequest(method, url, **skips) File "/usr/local/lib/python2.4/httplib.py", line 750, in putrequest self.putheader('Host', "%s:%s" % (self.host.encode("idna"), self.port)) LookupError: unknown encoding: idna 如果用PYTHON XXX.PY运行,则没有错误,用FREEZE后就不行。 环境:LINUX 谢谢。 致 礼! cry zyqmail at tom.com
2006年02月23日 星期四 21:34
On 2/23/06, cry <zyqmail at tom.com> wrote: > python,您好! > > 下面的程序: > conn = httplib.HTTPConnection("XXX.XXX.XXX.XXX:8009") > conn.request("POST", "/", xmlquery) > 出现错误: > File "mobilereg.py", line 48, in AofaReg > conn.request("POST", "/", xmlquery) > File "/usr/local/lib/python2.4/httplib.py", line 800, in request > self._send_request(method, url, body, headers) > File "/usr/local/lib/python2.4/httplib.py", line 817, in _send_request > self.putrequest(method, url, **skips) > File "/usr/local/lib/python2.4/httplib.py", line 750, in putrequest > self.putheader('Host', "%s:%s" % (self.host.encode("idna"), self.port)) > LookupError: unknown encoding: idna > > 如果用PYTHON XXX.PY运行,则没有错误,用FREEZE后就不行。 > 环境:LINUX > 这说明编码不对。原因我想源码运行时可能从encodings下找个idna的编码。但freeze后可能没有把encodings目录打全,因此找不到了。 -- I like python! My Blog: http://www.donews.net/limodou NewEdit Maillist: http://groups.google.com/group/NewEdit
Zeuux © 2025
京ICP备05028076号