Message125731
| Author |
nadeem.vawda |
| Recipients |
lukasz.langa, nadeem.vawda, vstinner |
| Date |
2011年01月07日.23:51:53 |
| SpamBayes Score |
0.0001254908 |
| Marked as misclassified |
No |
| Message-id |
<1294444316.69.0.618751710529.issue10512@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Sorry, scratch that - I misunderstood the semantics of SocketIO.close(). I hadn't realized that the underlying socket is supposed to stay open until it itself is also explicitly closed (as well as all SocketIO objects referring to it).
I've been able to get rid of 2 of the 7 warnings in test_urllib2net with the following change:
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -2151,7 +2151,9 @@
conn = self.ftp.ntransfercmd(cmd)
self.busy = 1
# Pass back both a suitably decorated object and a retrieval length
- return (addclosehook(conn[0].makefile('rb'), self.endtransfer), conn[1])
+ fp = addclosehook(conn[0].makefile('rb'), self.endtransfer)
+ conn[0].close()
+ return (fp, conn[1])
def endtransfer(self):
if not self.busy:
return
It seems that most of the remaining warnings are the result of FTPHandler.ftp_open() not doing anything to close the ftpwrapper objects it creates. I haven't been able to figure out exactly what the correct place to do this is, though. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年01月07日 23:51:56 | nadeem.vawda | set | recipients:
+ nadeem.vawda, vstinner, lukasz.langa |
| 2011年01月07日 23:51:56 | nadeem.vawda | set | messageid: <1294444316.69.0.618751710529.issue10512@psf.upfronthosting.co.za> |
| 2011年01月07日 23:51:53 | nadeem.vawda | link | issue10512 messages |
| 2011年01月07日 23:51:53 | nadeem.vawda | create |
|