From: <pj...@us...> - 2009-05-29 05:27:48
|
Revision: 6420 http://jython.svn.sourceforge.net/jython/?rev=6420&view=rev Author: pjenvey Date: 2009-05-29 05:27:30 +0000 (Fri, 29 May 2009) Log Message: ----------- close file handles Modified Paths: -------------- trunk/jython/Lib/urllib.py Modified: trunk/jython/Lib/urllib.py =================================================================== --- trunk/jython/Lib/urllib.py 2009-05-29 02:42:15 UTC (rev 6419) +++ trunk/jython/Lib/urllib.py 2009-05-29 05:27:30 UTC (rev 6420) @@ -44,7 +44,7 @@ # Helper for non-unix systems if os.name == 'mac': from macurl2path import url2pathname, pathname2url -elif os.name == 'nt' or sys.platform.startswith('java') and os._name == 'nt': +elif (os._name if sys.platform.startswith('java') else os.name) == 'nt': from nturl2path import url2pathname, pathname2url elif os.name == 'riscos': from rourl2path import url2pathname, pathname2url @@ -215,7 +215,7 @@ try: fp = self.open_local_file(url1) hdrs = fp.info() - del fp + fp.close() return url2pathname(splithost(url1)[1]), hdrs except IOError, msg: pass @@ -1496,7 +1496,7 @@ print '======' fp = open(fn, 'rb') data = fp.read() - del fp + fp.close() if '\r' in data: table = string.maketrans("", "") data = data.translate(table, "\r") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |