467,211 Members | 1,206 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,211 developers. It's quick & easy.

urllib.urlopen fails in Emacs

In Emacs, using run-python,

import urllib
urllib.urlopen('http://www.google.com/')

results in this traceback:

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 860, in endheaders
self._send_output()
File "/usr/lib/python2.5/httplib.py", line 732, in _send_output
self.send(msg)
File "/usr/lib/python2.5/httplib.py", line 699, in send
self.connect()
File "/usr/lib/python2.5/httplib.py", line 683, in connect
raise socket.error, msg
IOError: [Errno socket error] (111, 'Connection refused')

It works fine from the command line. Why is this happening?
Sep 26 '08 #1
  • viewed: 1661
Share:
2 Replies
On Fri, 26 Sep 2008 02:23:18 -0600, Iain Dalton wrote:
In Emacs, using run-python,

import urllib
urllib.urlopen('http://www.google.com/')

results in this traceback:
....
IOError: [Errno socket error] (111, 'Connection refused')

It works fine from the command line. Why is this happening?
I can't answer your question, since I don't use emacs,
but it looks like emacs has some kind of built in firewall.

;-)

--
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
Sep 26 '08 #2
On 26 Sep, 12:21, Wojtek Walczak <gmin...@bzt.bztwrote:
On Fri, 26 Sep 2008 02:23:18 -0600, Iain Dalton wrote:
InEmacs, using run-python,
* * import urllib
* *urllib.urlopen('http://www.google.com/')
results in this traceback:
...
* * IOError: [Errno socket error] (111, 'Connection refused')
It works fine from the command line. *Why is this happening?

I can't answer your question, since I don't useemacs,
but it looks likeemacshas some kind of built in firewall.

;-)

--
Regards,
Wojtek Walczak,http://tosh.pl/gminick/
I don't think it is emacs... It works for me, using emacs 22.1, python
2.5.1, and windows XP:

Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>import urllib
urllib.urlopen('http://www.google.com/')
<addinfourl at 12530592 whose fp = <socket._fileobject object at
0x00BF4030>>
>>>
/Niklas Norrthon
Sep 26 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Richard Shea | last post: by
11 posts views Thread by Pater Maximus | last post: by
reply views Thread by Pieter Edelman | last post: by
1 post views Thread by Timothy Wu | last post: by
4 posts views Thread by william@opensource4you.com | last post: by
6 posts views Thread by JabaPyth | last post: by
reply views Thread by Ali.Sabil@gmail.com | last post: by
4 posts views Thread by kgrafals@gmail.com | last post: by
1 post views Thread by Edwin.Madari@VerizonWireless.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.