Issues where macports python fails but system python works

David Osguthorpe david.osguthorpe at gmail.com
Tue May 5 07:01:01 PDT 2009


Hi,

I know the macports developers dont like using Apple supplied stuff
but here is an inverse case - where the system supplied python works
but macports python doesnt.

running macports python with a python script that has worked for a year or so
(from Panther to Leopard) gives the following errors:

>Traceback (most recent call last):
>  File "ofx.py", line 179, in <module>
>    client.doQuery(query, argv[1]+"_"+argv[3]+"_"+dtnow+".ofx")
>  File "ofx.py", line 144, in doQuery
>    f = urllib2.urlopen(request)
>  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 124, in urlopen
>    return _opener.open(url, data)
>  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 381, in open
>    response = self._open(req, data)
>  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 404, in _open
>    'unknown_open', req)
>  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 360, in _call_chain
>    result = func(*args)
>  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 1140, in unknown_open
>    raise URLError('unknown url type: %s' % type)
>urllib2.URLError: <urlopen error unknown url type: https>


its nice that urllib2.py thinks https is an unknown url type

running with the system python everything works

the macports python probably got installed because Im using  py-gtk2 which seems
to be working in another project - and why this script used to work under Leopard before
installing the py-gtk2 port

differencing the system urllib2.py and macports shows some differences - but not a reason why getting
the above error

diff /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py /opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py
58c58,61
< authinfo.add_password('realm', 'host', 'username', 'password')
---
> authinfo.add_password(realm='PDQ Application',
>                       uri='https://mahler:8092/site-updates.py',
>                       user='klem',
>                       passwd='geheim$parole')
297a301,304
>         if not hasattr(handler, "add_parent"):
>             raise TypeError("expected BaseHandler instance, got %r" %
>                             type(handler))
> 
948c955
<             pass
---
>             raise URLError("qop '%s' is not supported." % qop)


if you are going to re-install all these system provided utilities it would be good
if they worked

probably some base python dependency isnt being included to make this work - Im wondering if its
something to do with ssl and some specific extra python module needed for that to work
- but I dont really want to be hunting this down - particularly if it works with the system python

David


More information about the macports-dev mailing list