[IronPython] Can not use httplib in ironpython beta9?

peter lin dingyi.lin at gmail.com
Tue Jul 18 19:02:20 CEST 2006


It seems the method getaddrinfo() is not currently implemented.
I test another module urllib, which uses  httplib.

import sys
sys.path.append(r"c:\python24\lib")

import urllib
data = urllib.urlopen('http://www.google.com').read()
print data

See the error as follows.

Traceback (most recent call last):
  File c:\dev_tool\IronPython-1.0-Beta9\rsslibtest.py, line 37, in
Initialize
  File c:\python24\lib\urllib.py, line 82, in urlopen
  File c:\python24\lib\urllib.py, line 194, in open
  File c:\python24\lib\urllib.py, line 313, in open_http
  File c:\python24\lib\httplib.py, line 798, in endheaders
  File c:\python24\lib\httplib.py, line 679, in _send_output
  File c:\python24\lib\httplib.py, line 646, in send
  File c:\python24\lib\httplib.py, line 613, in connect
  File , line 0, in GetAddrInfo##120
NotImplementedError: getaddrinfo() is not currently implemented

I test it with python.exe , it works.
So, actually, Is it ok to use all python standard library with ipy?


2006/7/18, M. David Peterson <xmlhacker at gmail.com>:
>
> uh, minus the second "Seems to be standing in the way"... not sure how
> that got tagged onto the end.  Must have been between thoughts when I hit
> send.
>
>
> On 7/18/06, M. David Peterson <xmlhacker at gmail.com> wrote:
> >
> > If you attempt to import encodings.idna, it seems as if the unicodedata
> > module is the missing piece.  The ever resourceful Seo Sanghyeon comes
> > to the rescue yet again >
> > http://lists.ironpython.com/pipermail/users-ironpython.com/2006-July/002819.html<
> >
> > Unfortunately > AttributeError: 'module' object has no attribute
> > 'unidata_version' < seems to be standing in the way of any sort of success
> > at present time.
> >
> > Seems to be standing in the way
> >
> > On 7/18/06, peter lin < dingyi.lin at gmail.com> wrote:
> >
> > > After reading the tutorial I think it's ok to use httplib, so I write
> > a test code
> > to test it with ipy.
> > I just cannot let it run ok with ipy.
> > Is something wrong I have done?
> >
> > My test code as follows
> >
> > import sys
> > sys.path.append(r"c:\python24\lib")
> > import httplib
> > conn =  httplib.HTTPConnection(' www.pchome.com.tw')
> > conn.request("GET", "/index.html")
> > r1 = conn.getresponse()
> > if r1.status==200:
> >     print r1.read()
> >
> > Here is the error I found when use ipy.exe
> >
> > Traceback (most recent call last):
> >   File c:\dev_tool\IronPython-1.0-Beta9\rsslibtest.py , line 23, in
> > Initialize
> >   File c:\python24\lib\httplib.py, line 810, in request
> >   File c:\python24\lib\httplib.py, line 821, in _send_request
> >   File c:\python24\lib\httplib.py, line 752, in putrequest
> >   File , line 0, in Encode##71
> > LookupError: unknown encoding: idna
> >
> > but it runs ok and gets the response when i use python.exe to run my
> > test py code
> > (remove two lines
> > import sys
> > sys.path.append(r"c:\python24\lib")
> >
> >
> >
> >
> >
> > _______________________________________________
> > users mailing list
> > users at lists.ironpython.com
> > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> >
> >
> >
> >
> >
> > --
> > /M:D
> >
> > M. David Peterson
> > http://mdavid.name | http://www.oreillynet.com/pub/au/2354
> >
>
>
>
> --
> /M:D
>
> M. David Peterson
> http://mdavid.name | http://www.oreillynet.com/pub/au/2354
>
> _______________________________________________
> users mailing list
> users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20060719/459b25be/attachment.html>


More information about the Ironpython-users mailing list