[Zope3-checkins] SVN: Zope3/trunk/src/mechanize/_opener.py mechanize fix for Python2.5

nikhil n nikhil.n.n at gmail.com
Sat Aug 18 03:20:01 EDT 2007


Log message for revision 78918:
  mechanize fix for Python2.5

Changed:
  U   Zope3/trunk/src/mechanize/_opener.py

-=-
Modified: Zope3/trunk/src/mechanize/_opener.py
===================================================================
--- Zope3/trunk/src/mechanize/_opener.py	2007-08-18 05:31:06 UTC (rev 78917)
+++ Zope3/trunk/src/mechanize/_opener.py	2007-08-18 07:19:59 UTC (rev 78918)
@@ -8,6 +8,7 @@
 COPYING.txt included with the distribution).
 
 """
+import sys
 
 import urllib2, string, bisect, urlparse
 
@@ -232,6 +233,8 @@
         urlopen = getattr(urllib2.OpenerDirector, "_open",
                           urllib2.OpenerDirector.open)
         response = urlopen(self, req, data)
+        if sys.version_info >= (2,5):
+            response.fp._close = False
 
         # post-process response
         response_processors = set(self.process_response.get(req_scheme, []))



More information about the Zope3-Checkins mailing list