Python 2.6.1 urllib error on Mac os x PPC

Attila Soki atiware at gmx.net
Mon Mar 2 11:12:56 EST 2009


hi,

i trying to compile Python 2.6.1 on Mac OS X (ppc).
After configure/make/make install i test the compiled python with
the followig file (t.py) (example from http://docs.python.org/library/urllib.html):
-------------
import urllib
params = urllib.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0})
f = urllib.urlopen("http://www.musi-cal.com/cgi-bin/query", params)
print f.read()
-------------

and i get this error:

python /tmp/t.py 
Traceback (most recent call last):
  File "/tmp/t.py", line 3, in <module>
    f = urllib.urlopen("http://www.musi-cal.com/cgi-bin/query", params)
  File "/usr/local/test/python/lib/python2.6/urllib.py", line 82, in urlopen
    opener = FancyURLopener()
  File "/usr/local/test/python/lib/python2.6/urllib.py", line 611, in __init__
    URLopener.__init__(self, *args, **kwargs)
  File "/usr/local/test/python/lib/python2.6/urllib.py", line 129, in __init__
    proxies = getproxies()
  File "/usr/local/test/python/lib/python2.6/urllib.py", line 1555, in getproxies
    return getproxies_environment() or getproxies_macosx_sysconf()
  File "/usr/local/test/python/lib/python2.6/urllib.py", line 1449, in getproxies_macosx_sysconf
    _CFSetup(sc)
  File "/usr/local/test/python/lib/python2.6/urllib.py", line 1330, in _CFSetup
    sc.CFStringCreateWithCString.argtypes = [ c_void_p, c_char_p, c_int32 ]
  File "/usr/local/test/python/lib/python2.6/ctypes/__init__.py", line 366, in __getattr__
    func = self.__getitem__(name)
  File "/usr/local/test/python/lib/python2.6/ctypes/__init__.py", line 371, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(RTLD_DEFAULT, CFStringCreateWithCString): symbol not found
Exception AttributeError: "FancyURLopener instance has no attribute 'tempcache'" in <bound method FancyURLopener.__del__ of <urllib.FancyURLopener instance at 0x3743a0>> ignored


The same build works on Mac Os X with intel CPU without errors. MAC OS and developertools are the same on both Computer. 

Mac OS X: 10.5.6
Developertools: xcode311_2517
How i build it:

export MACOSX_DEPLOYMENT_TARGET=10.5
configure --prefix/usr/local/test/python
make
make install

How i test:

export PYTHONPATH=/usr/local/test/python:/usr/local/test/python/lib/python2.6/site-packages

/usr/local/test/python/bin/ is in the PATH

python /tmp/t.py



please help me to find out why this error occurs.



thanks,

Attila Soki

-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger01



More information about the Python-list mailing list