<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 <<a href="mailto:python-checkins@python.org">python-checkins@python.org</a>>:<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"> 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"> # Search for universal newlines or line chunks.<br></blockquote><blockquote type="cite"> PATTERN = re.compile(br'^(?P<chunk>[^\r\n]+)|(?P<newline>\n|\r\n?)')<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">- def __init__(self, fileobj, mode, zipinfo, decrypter=None):<br></blockquote><blockquote type="cite">+ def __init__(self, fileobj, mode, zipinfo, decrypter=None,<br></blockquote><blockquote type="cite">+ close_fileobj=False):<br></blockquote><blockquote type="cite"> self._fileobj = fileobj<br></blockquote><blockquote type="cite"> self._decrypter = decrypter<br></blockquote><blockquote type="cite">+ self._close_fileobj = close_fileobj<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> self._compress_type = zipinfo.compress_type<br></blockquote><blockquote type="cite"> self._compress_size = zipinfo.compress_size<br></blockquote><blockquote type="cite">@@ -647,6 +649,12 @@<br></blockquote><blockquote type="cite"> self._offset += len(data)<br></blockquote><blockquote type="cite"> return data<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">+ def close(self):<br></blockquote><blockquote type="cite">+ try:<br></blockquote><blockquote type="cite">+ if self._close_fileobj:<br></blockquote><blockquote type="cite">+ self._fileobj.close()<br></blockquote><blockquote type="cite">+ finally:<br></blockquote><blockquote type="cite">+ super().close()<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> class ZipFile:<br></blockquote><blockquote type="cite">@@ -889,8 +897,10 @@<br></blockquote><blockquote type="cite"> # given a file object in the constructor<br></blockquote><blockquote type="cite"> if self._filePassed:<br></blockquote><blockquote type="cite"> zef_file = self.fp<br></blockquote><blockquote type="cite">+ should_close = False<br></blockquote><blockquote type="cite"> else:<br></blockquote><blockquote type="cite"> zef_file = io.open(self.filename, 'rb')<br></blockquote><blockquote type="cite">+ should_close = True<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> # Make sure we have an info object<br></blockquote><blockquote type="cite"> if isinstance(name, ZipInfo):<br></blockquote><blockquote type="cite">@@ -944,7 +954,7 @@<br></blockquote><blockquote type="cite"> if h[11] != check_byte:<br></blockquote><blockquote type="cite"> raise RuntimeError("Bad password for file", name)<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">- return ZipExtFile(zef_file, mode, zinfo, zd)<br></blockquote><blockquote type="cite">+ return ZipExtFile(zef_file, mode, zinfo, zd, close_fileobj=should_close)<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"> def extract(self, member, path=None, pwd=None):<br></blockquote><blockquote type="cite"> """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; ">-- </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>