* Re: A problem while using urllib
[not found] ` <434CC861.2080805@holdenweb.com>
@ 2005-10-12 8:57 ` Steve Holden
2005-10-12 9:15 ` Corinna Vinschen
0 siblings, 1 reply; 3+ messages in thread
From: Steve Holden @ 2005-10-12 8:57 UTC (permalink / raw)
To: johnnyandfiona; +Cc: cygwin
Steve Holden wrote:
> Johnny Lee wrote:
> [...]
>
>>I've sent the source, thanks for your help.
>>
>
> [...]
> Preliminary result, in case this rings bells with people who use urllib2
> quite a lot. I modified the error case to report the actual message
> returned with the exception and I'm seeing things like:
>
> http://www.holdenweb.com/./Python/webframeworks.html
> Message: <urlopen error (120, 'Operation already in progress')>
> Start process
> http://www.amazon.com/exec/obidos/ASIN/0596001886/steveholden-20
> Error: IOError while parsing
> http://www.amazon.com/exec/obidos/ASIN/0596001886/steveholden-20
> Message: <urlopen error (120, 'Operation already in progress')>
> .
> .
> .
>
> So at least we know now what the error is, and it looks like some sort
> of resource limit (though why only on Cygwin betas me) ... anyone,
> before I start some serious debugging?
>
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: <urlopen error (120, 'Operation already in progress')>
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: <urlopen error (120, 'Operation already in progress')>
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).
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
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/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: A problem while using urllib
2005-10-12 8:57 ` A problem while using urllib Steve Holden
@ 2005-10-12 9:15 ` Corinna Vinschen
2005-10-12 9:32 ` Steve Holden
0 siblings, 1 reply; 3+ messages in thread
From: Corinna Vinschen @ 2005-10-12 9:15 UTC (permalink / raw)
To: cygwin; +Cc: Steve Holden, johnnyandfiona
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: <urlopen error (120, 'Operation already in progress')>
> 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: <urlopen error (120, 'Operation already in progress')>
>
> 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/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: A problem while using urllib
2005-10-12 9:15 ` Corinna Vinschen
@ 2005-10-12 9:32 ` Steve Holden
0 siblings, 0 replies; 3+ messages in thread
From: Steve Holden @ 2005-10-12 9:32 UTC (permalink / raw)
To: cygwin
Corinna Vinschen wrote:
> On Oct 12 09:57, Steve Holden wrote:
[...]
>
> 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:
Thanks for your note. This is actually johnny's problem, I was just
helping him to locate the error. You might notice Jason Tishler was
copied on my post, and I'm hoping he and Johnny will be able to isolate
the problem.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
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/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-10-12 9:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <1129024641.113182.74420@g49g2000cwa.googlegroups.com>
[not found] ` <1h49slu.1gaj0nnmdk5ghN%aleax@mail.comcast.net>
[not found] ` <1129089078.852454.153800@f14g2000cwb.googlegroups.com>
[not found] ` <mailman.1937.1129100649.509.python-list@python.org>
[not found] ` <1129102671.990994.43590@f14g2000cwb.googlegroups.com>
[not found] ` <434CC861.2080805@holdenweb.com>
2005-10-12 8:57 ` A problem while using urllib Steve Holden
2005-10-12 9:15 ` Corinna Vinschen
2005-10-12 9:32 ` Steve Holden
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).