<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>Wiadomość napisana przez Benjamin Peterson w dniu 2010-11-23, o godz. 00:47:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>No test?<br><br></div></blockquote><div><br></div><div>The tests were there already, raising ResourceWarnings. After this change, they stopped doing that. You may say: now they pass for the first time :)</div><div><br></div><div>Best regards,</div><div>Łukasz</div><div><br></div><br><blockquote type="cite"><div>2010/11/22 lukasz.langa &lt;<a href="mailto:python-checkins@python.org">python-checkins@python.org</a>&gt;:<br><blockquote type="cite">Author: lukasz.langa<br></blockquote><blockquote type="cite">Date: Tue Nov 23 00:31:26 2010<br></blockquote><blockquote type="cite">New Revision: 86699<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Log:<br></blockquote><blockquote type="cite">Issue #9846: ZipExtFile provides no mechanism for closing the underlying file object<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Modified:<br></blockquote><blockquote type="cite">&nbsp; python/branches/py3k/Lib/zipfile.py<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Modified: python/branches/py3k/Lib/zipfile.py<br></blockquote><blockquote type="cite">==============================================================================<br></blockquote><blockquote type="cite">--- python/branches/py3k/Lib/zipfile.py (original)<br></blockquote><blockquote type="cite">+++ python/branches/py3k/Lib/zipfile.py Tue Nov 23 00:31:26 2010<br></blockquote><blockquote type="cite">@@ -473,9 +473,11 @@<br></blockquote><blockquote type="cite">&nbsp; &nbsp; # Search for universal newlines or line chunks.<br></blockquote><blockquote type="cite">&nbsp; &nbsp; PATTERN = re.compile(br'^(?P&lt;chunk&gt;[^\r\n]+)|(?P&lt;newline&gt;\n|\r\n?)')<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">- &nbsp; &nbsp;def __init__(self, fileobj, mode, zipinfo, decrypter=None):<br></blockquote><blockquote type="cite">+ &nbsp; &nbsp;def __init__(self, fileobj, mode, zipinfo, decrypter=None,<br></blockquote><blockquote type="cite">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; close_fileobj=False):<br></blockquote><blockquote type="cite">&nbsp; &nbsp; &nbsp; &nbsp; self._fileobj = fileobj<br></blockquote><blockquote type="cite">&nbsp; &nbsp; &nbsp; &nbsp; self._decrypter = decrypter<br></blockquote><blockquote type="cite">+ &nbsp; &nbsp; &nbsp; &nbsp;self._close_fileobj = close_fileobj<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">&nbsp; &nbsp; &nbsp; &nbsp; self._compress_type = zipinfo.compress_type<br></blockquote><blockquote type="cite">&nbsp; &nbsp; &nbsp; &nbsp; self._compress_size = zipinfo.compress_size<br></blockquote><blockquote type="cite">@@ -647,6 +649,12 @@<br></blockquote><blockquote type="cite">&nbsp; &nbsp; &nbsp; &nbsp; self._offset += len(data)<br></blockquote><blockquote type="cite">&nbsp; &nbsp; &nbsp; &nbsp; return data<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">+ &nbsp; &nbsp;def close(self):<br></blockquote><blockquote type="cite">+ &nbsp; &nbsp; &nbsp; &nbsp;try:<br></blockquote><blockquote type="cite">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if self._close_fileobj:<br></blockquote><blockquote type="cite">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;self._fileobj.close()<br></blockquote><blockquote type="cite">+ &nbsp; &nbsp; &nbsp; &nbsp;finally:<br></blockquote><blockquote type="cite">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;super().close()<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">&nbsp;class ZipFile:<br></blockquote><blockquote type="cite">@@ -889,8 +897,10 @@<br></blockquote><blockquote type="cite">&nbsp; &nbsp; &nbsp; &nbsp; # given a file object in the constructor<br></blockquote><blockquote type="cite">&nbsp; &nbsp; &nbsp; &nbsp; if self._filePassed:<br></blockquote><blockquote type="cite">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zef_file = self.fp<br></blockquote><blockquote type="cite">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;should_close = False<br></blockquote><blockquote type="cite">&nbsp; &nbsp; &nbsp; &nbsp; else:<br></blockquote><blockquote type="cite">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zef_file = io.open(self.filename, 'rb')<br></blockquote><blockquote type="cite">+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;should_close = True<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">&nbsp; &nbsp; &nbsp; &nbsp; # Make sure we have an info object<br></blockquote><blockquote type="cite">&nbsp; &nbsp; &nbsp; &nbsp; if isinstance(name, ZipInfo):<br></blockquote><blockquote type="cite">@@ -944,7 +954,7 @@<br></blockquote><blockquote type="cite">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if h[11] != check_byte:<br></blockquote><blockquote type="cite">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; raise RuntimeError("Bad password for file", name)<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">- &nbsp; &nbsp; &nbsp; &nbsp;return &nbsp;ZipExtFile(zef_file, mode, zinfo, zd)<br></blockquote><blockquote type="cite">+ &nbsp; &nbsp; &nbsp; &nbsp;return &nbsp;ZipExtFile(zef_file, mode, zinfo, zd, close_fileobj=should_close)<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">&nbsp; &nbsp; def extract(self, member, path=None, pwd=None):<br></blockquote><blockquote type="cite">&nbsp; &nbsp; &nbsp; &nbsp; """Extract a member from the archive to the current working directory,<br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">Python-checkins mailing list<br></blockquote><blockquote type="cite"><a href="mailto:Python-checkins@python.org">Python-checkins@python.org</a><br></blockquote><blockquote type="cite"><a href="http://mail.python.org/mailman/listinfo/python-checkins">http://mail.python.org/mailman/listinfo/python-checkins</a><br></blockquote><blockquote type="cite"><br></blockquote><br><br><br>-- <br>Regards,<br>Benjamin<br>_______________________________________________<br>Python-checkins mailing list<br><a href="mailto:Python-checkins@python.org">Python-checkins@python.org</a><br>http://mail.python.org/mailman/listinfo/python-checkins<br></div></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Verdana; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Verdana; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Verdana; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Verdana; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Verdana; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Verdana; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px; ">--&nbsp;</span></font></div><div><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px; ">Pozdrawiam serdecznie,</span></font></div><div><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px; ">Łukasz Langa</span></font></div><div><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px; ">tel. +48 791 080 144</span></font></div><div><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px; ">WWW <a href="http://lukasz.langa.pl/">http://lukasz.langa.pl/</a></span></font></div></div></span></div></span></div></span></div></span></div></span></span>
</div>
<br></body></html>