Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Wed, 12 Oct 2005 11:15:18 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Cc: Steve Holden , johnnyandfiona AT hotmail DOT com Subject: Re: A problem while using urllib Message-ID: <20051012091518.GY12938@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com, Steve Holden , johnnyandfiona AT hotmail DOT com References: <1129024641 DOT 113182 DOT 74420 AT g49g2000cwa DOT googlegroups DOT com> <1h49slu.1gaj0nnmdk5ghN%aleax AT mail DOT comcast DOT net> <1129089078 DOT 852454 DOT 153800 AT f14g2000cwb DOT googlegroups DOT com> <1129102671 DOT 990994 DOT 43590 AT f14g2000cwb DOT googlegroups DOT com> <434CC861 DOT 2080805 AT holdenweb DOT com> <434CCFDE DOT 7000409 AT holdenweb DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <434CCFDE.7000409@holdenweb.com> User-Agent: Mutt/1.4.2i Note-from-DJ: This may be spam On Oct 12 09:57, Steve Holden wrote: > I realized after this post that WingIDE doesn't run under Cygwin, so I > modified the code further to raise an error and give us a proper > traceback. I also tested the program under the standard Windows 2.4.1 > release, where it didn't fail, so I conclude you have unearthed a Cygwin > socket bug. Here's the traceback: > > End process http://www.holdenweb.com/contact.html > Start process http://freshmeat.net/releases/192449 > Error: IOError while parsing http://freshmeat.net/releases/192449 > Message: > Traceback (most recent call last): > File "Spider_bug.py", line 225, in ? > spider.run() > File "Spider_bug.py", line 143, in run > self.grabUrl(tempUrl) > File "Spider_bug.py", line 166, in grabUrl > webPage = urllib2.urlopen(url).read() > File "/usr/lib/python2.4/urllib2.py", line 130, in urlopen > return _opener.open(url, data) > File "/usr/lib/python2.4/urllib2.py", line 358, in open > response = self._open(req, data) > File "/usr/lib/python2.4/urllib2.py", line 376, in _open > '_open', req) > File "/usr/lib/python2.4/urllib2.py", line 337, in _call_chain > result = func(*args) > File "/usr/lib/python2.4/urllib2.py", line 1021, in http_open > return self.do_open(httplib.HTTPConnection, req) > File "/usr/lib/python2.4/urllib2.py", line 996, in do_open > raise URLError(err) > urllib2.URLError: > > Looking at that part of the course of urrllib2 we see: > > headers["Connection"] = "close" > try: > h.request(req.get_method(), req.get_selector(), req.data, > headers) > r = h.getresponse() > except socket.error, err: # XXX what error? > raise URLError(err) > > So my conclusion is that there's something in the Cygwin socket module > that causes problems not seen under other platforms. > > I couldn't find any obviously-related error in the Python bug tracker, > and I have copied this message to the Cygwin list in case someone there > knows what the problem is. > > Before making any kind of bug submission you should really see if you > can build a program shorter that the existing 220+ lines to demonstrate > the bug, but it does look to me like your program should work (as indeed > it does on other platforms). Talking about a testcase, if you want to submit a bug report, could you please apply a simple, self-contained, OOTB testcase, written in plain C, which shows what's going on? I just see an EINPROGRESS error message above and I don't speak Python. If this is something Cygwin induced, then I see only two potential problems, both in connect(). Either a connect is called twice on a blocking socket, or a connection fails and the error code is wrong for some reason. A simple testcase would help enormously. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat, Inc. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/