Re: Python urllib2 problem: Name or service not known

2012-02-28 Thread Alex Borghgraef
On Feb 28, 10:50 am, Alex Borghgraef wrote: > I'll still have to find out a way to get this thing working with proxy > enabled if I ever want to connect it to our overall network. Ok, doing os.environ['http_proxy']='' before importing urllib2 seems to do the trick for that. -- Alex -- http:/

Re: Python urllib2 problem: Name or service not known

2012-02-28 Thread Alex Borghgraef
On Feb 28, 1:36 am, Steven D'Aprano wrote: > On Mon, 27 Feb 2012 12:48:27 -0800, Alex Borghgraef wrote: > > Hi all, > > > Some time ago I've written some python code to read video data off an IP > > camera connected via a router to a laptop. Now I try to run this code on > > a different laptop and

Re: Python urllib2 problem: Name or service not known

2012-02-27 Thread Steven D'Aprano
On Mon, 27 Feb 2012 12:48:27 -0800, Alex Borghgraef wrote: > Hi all, > > Some time ago I've written some python code to read video data off an IP > camera connected via a router to a laptop. Now I try to run this code on > a different laptop and router combination, but now I can't access the > ca

Python urllib2 problem: Name or service not known

2012-02-27 Thread Alex Borghgraef
Hi all, Some time ago I've written some python code to read video data off an IP camera connected via a router to a laptop. Now I try to run this code on a different laptop and router combination, but now I can't access the camera. Some minimal example code: import urllib2 url = urllib2.urlo

Re: Inexplicable Urllib2 problem between virtualenv's when POSTing to a Tomcat server

2011-09-25 Thread Timmy O'Mahony
Good point. The two machines that the code works with are running python 2.6.1 and 2.7.2 and are running on my Mac (Snow Leopard) The two non-working machines are running python 2.6.6 and 2.7.1 and are on Debian 6 and Debian 5 respectively. They are VPSs managed by different providers. All of

Re: Inexplicable Urllib2 problem between virtualenv's when POSTing to a Tomcat server

2011-09-25 Thread Devin Jeanpierre
It might help to give more information about the machines. In particular, what versions of Python are on the production machines? Devin On Sun, Sep 25, 2011 at 8:31 AM, Timmy O'Mahony wrote: > Hey, I have a question on Stackoverflow at the moment that I thought I would > put up here as it might

Inexplicable Urllib2 problem between virtualenv's when POSTing to a Tomcat server

2011-09-25 Thread Timmy O'Mahony
Hey, I have a question on Stackoverflow at the moment that I thought I would put up here as it might get some more eyes (It has a bounty so feel free to answer there if you have a SO account!) I have some test code (as a part of a webapp) that uses urllib2 to perform an operation I would

Re: urllib2 problem, data param not working? : DISREGARD

2009-04-01 Thread Gabriel Rossetti
Gabriel Rossetti wrote: Hello everyone, I am having a problem with urllib2, when I do this : post = urllib.urlencode(post) request = urllib2.Request(url, post) response = urllib2.urlopen(request) or this : post = urllib.urlencode(post) response = urllib2.urlopen(url, post) or

urllib2 problem, data param not working?

2009-03-31 Thread Gabriel Rossetti
Hello everyone, I am having a problem with urllib2, when I do this : post = urllib.urlencode(post) request = urllib2.Request(url, post) response = urllib2.urlopen(request) or this : post = urllib.urlencode(post) response = urllib2.urlopen(url, post) or this : post = urllib.

urllib2: problem of handling space in parameter

2009-02-07 Thread rdmurray
Quoth Muddy Coder : > Hi Folks, > > I encrountered a problem of using urllib2: the space handling. Look at > the code below: > > import urllib2 > url = r'http://somedomain.com/a.cgi?name=muddy coder&password=foobar > cgi_back = urllib2.urlopen(url).read() > > In this cgi_back, I saw field passwo

urllib2: problem of handling space in parameter

2009-02-07 Thread Muddy Coder
Hi Folks, I encrountered a problem of using urllib2: the space handling. Look at the code below: import urllib2 url = r'http://somedomain.com/a.cgi?name=muddy coder&password=foobar cgi_back = urllib2.urlopen(url).read() In this cgi_back, I saw field password worked fine, but field name not, only

Re: URLLIb2 problem

2008-06-30 Thread Jerry Hill
On Mon, Jun 30, 2008 at 4:11 PM, <[EMAIL PROTECTED]> wrote: > I am trying to write somecode of this kind :) > > opener = urllib2.build_opener(urllib2.HTTPCookieProcessor()) > opener.addheaders = [ ... > ('Accept-Encoding','gzip,deflate'), ... > urllib2.install_opener(opener) > > fu = urllib2.urlop

Re: URLLIb2 problem

2008-06-30 Thread Fuzzyman
On Jun 30, 9:11 pm, [EMAIL PROTECTED] wrote: > I am trying to write somecode of this kind :) > > opener = urllib2.build_opener(urllib2.HTTPCookieProcessor()) > opener.addheaders = [('User-Agent','Mozilla/5.0 (Windows; U; Windows > NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14'), > ('A

URLLIb2 problem

2008-06-30 Thread leechat2001
I am trying to write somecode of this kind :) opener = urllib2.build_opener(urllib2.HTTPCookieProcessor()) opener.addheaders = [('User-Agent','Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14'), ('Accept','text/xml,application/xml,application/xhtml+xml,t

Re: urllib2 problem with ports.

2006-06-16 Thread Ant
Fredrik Lundh wrote: > check your proxy configuration. most likely, your new machine is set up > to route all requests via a remote proxy. Here's me looking like a fool :-) The parts of the machine (eg Firefox, GAIM etc) that I'd set up use a direct connection - it looks like the guy who'd had

Re: urllib2 problem with ports.

2006-06-15 Thread Fredrik Lundh
Ant wrote: > This gives the output (Stack trace snipped - can post if required): > > urllib2.HTTPError: HTTP Error 502: Proxy Error ( The Uniform Resource > Locator (URL) does not use a recognized protocol. Either the protocol > This I believe is a problem with the addition of a non-default port

urllib2 problem with ports.

2006-06-15 Thread Ant
Hi all, I have just moved to a new machine, and so have installed the latest version of Python (2.4.3 - previously I believe I was running 2.4.2). Unfortunately this seems to have broken urllib2... An app I wrote for testing our web application makes heavy use of urllib2 against the localhost, an

Re: urllib2 problem

2005-10-28 Thread John J. Lee
"Jeremy Martin" <[EMAIL PROTECTED]> writes: [...] > website. I originally just used urllib.urlopen and everything worked > fine on my Windows PC at work. I tried the same script at home on my > Fedora COre 3 box using python 2.4, and whenever I try to connect to > the site I get the (110, Connec

urllib2 problem

2005-10-26 Thread Jeremy Martin
List, I'm relatively new to using python for interacting with webpages but Ive run into a problem that really has me stumped. I wrote a script that would figure out all the variables needed to request data from a website. I originally just used urllib.urlopen and everything worked fine on my

Re: urllib2 problem/bug: Request.add_header does() nothing?

2005-07-27 Thread Fuzzyman
[EMAIL PROTECTED] wrote: > I have a simple cgi-script on a server that prints all key-value pairs > from a request. And it really works when i use a browser and type smth > like http://server/cgi-bin/test?name=mike&johny=dummy. But when I use > the following script, nothing is printed (like i typ

urllib2 problem/bug: Request.add_header does() nothing?

2005-07-25 Thread kelio
I have a simple cgi-script on a server that prints all key-value pairs from a request. And it really works when i use a browser and type smth like http://server/cgi-bin/test?name=mike&johny=dummy. But when I use the following script, nothing is printed (like i type http://server/cgi-bin/test reques