Results 1 to 3 of 3
Discuss python urllib error at the Free Toolchain Software (Cydia App's) - Hackint0sh.org; Can someone confirm the following error with python on iPhone? I'm trying to use urllib ...
  1. #1
    oOo
    oOo is offline
    Newbie Array

    Join Date
    Sep 2007
    Posts
    5
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Unhappy python urllib error

    Can someone confirm the following error with python on iPhone? I'm trying to use urllib to access a website but I'm getting a socket error...

    Code:
    import urllib
    test = urllib.urlopen("http://www.google.com")
    I'm getting the following on the phone:

    Code:
    Python 2.5.1 (r251:54863, Jul 27 2007, 12:05:57) 
    [GCC 4.0.1 LLVM (Apple Computer, Inc. build 2.0)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import urllib
    >>> test = urllib.urlopen("http://www.google.com/")
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib/python2.5/urllib.py", line 82, in urlopen
        return opener.open(url)
      File "/usr/lib/python2.5/urllib.py", line 190, in open
        return getattr(self, name)(url)
      File "/usr/lib/python2.5/urllib.py", line 325, in open_http
        h.endheaders()
      File "/usr/lib/python2.5/httplib.py", line 856, in endheaders
        self._send_output()
      File "/usr/lib/python2.5/httplib.py", line 728, in _send_output
        self.send(msg)
      File "/usr/lib/python2.5/httplib.py", line 695, in send
        self.connect()
      File "/usr/lib/python2.5/httplib.py", line 663, in connect
        socket.SOCK_STREAM):
    IOError: [Errno socket error] (4, 'Non-recoverable failure in name resolution')
    Any ideas?



  2. #2
    Professional Array

    Join Date
    Aug 2007
    Posts
    54
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    10

    Default

    This code works:

    opener = urllib.URLopener()
    f = opener.open(url)
    f.read()

  3. #3
    Senior Professional Array

    Join Date
    Oct 2007
    Posts
    119
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    12

    Default

    Quote Originally Posted by lh99 View Post
    This code works:

    opener = urllib.URLopener()
    f = opener.open(url)
    f.read()
    i tried this... it doesn't work

 

 

Similar Threads

  1. how to combine Python with cocoa
    By demonlj in forum iPhone Developer Exchange
    Replies: 0
    Last Post: 09-15-2009, 05:43 PM
  2. How to install python
    By amicke in forum AppleTV 1
    Replies: 0
    Last Post: 04-21-2009, 11:26 PM
  3. [Python] can't install
    By nunoosorio in forum Tools
    Replies: 0
    Last Post: 01-24-2008, 01:42 PM
  4. Python and UIKit?
    By diogovaraujo in forum Free Toolchain Software (Cydia App's)
    Replies: 0
    Last Post: 12-29-2007, 09:20 PM
  5. How to compile Twisted-Python for iPhone?
    By lh99 in forum Free Toolchain Software (Cydia App's)
    Replies: 0
    Last Post: 09-16-2007, 04:08 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBulletin®
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Search Engine Friendly URLs by vBSEO
(c) 2006-2012 Hackint0sh.org
All times are GMT +2. The time now is 10:02 AM.
twitter, follow us!