List of commits:
Subject Hash Author Date (UTC)
bpo-30218: support path-like objects in shutil.unpack_archive() (GH-1367) a12df7b7d40dbf47825917c8fa03d2c09b5a382c Jelle Zijlstra 2017-05-05 21:27:12
bpo-29243: Fix Makefile with respect to --enable-optimizations (#1478) a1054c3b0037d4c2a5492e79fc193f36245366c7 torsava 2017-05-05 15:35:50
bpo-29920: Document cgitb.text() and cgitb.html() functions (GH-849) c07b3a15be5e0a68a73b4c532861ed8de6932bd2 masklinn 2017-05-05 08:15:12
bpo-30279: Remove unused Python/thread_foobar.h (#1473) fdaeea620f8c78da89cddba4ab010c64535800e0 Masayuki Yamamoto 2017-05-05 08:04:13
bpo-30264: ExpatParser closes the source on error (#1451) ef9c0e732fc50aefbdd7c5a80e04e14b31684e66 Victor Stinner 2017-05-05 07:46:47
bpo-30277: Replace _sre.getlower() with _sre.ascii_tolower() and _sre.unicode_tolower(). (#1468) 7186cc29be352bed6f1110873283d073fd0643e4 Serhiy Storchaka 2017-05-05 07:42:46
bpo-30243: Fixed the possibility of a crash in _json. (#1420) 76a3e51a403bc84ed536921866c86dd7d07aaa7e Serhiy Storchaka 2017-05-05 07:08:49
bpo-30215: Make re.compile() locale agnostic. (#1361) 898ff03e1e7925ecde3da66327d3cdc7e07625ba Serhiy Storchaka 2017-05-05 05:53:40
Make code coverage less strict (GH-1438) 647c3d381e67490e82cdbbe6c96e46d5e1628ce2 Brett Cannon 2017-05-04 21:58:54
bpo-30273: Update sysconfig (#1464) b109a1d3360fc4bb87b9887264e3634632d392ca Victor Stinner 2017-05-04 21:29:09
bpo-30185: avoid KeyboardInterrupt tracebacks in forkserver (#1319) 6dd4d734ed207ba16b017e38f8909de7ef187e29 Antoine Pitrou 2017-05-04 14:44:53
bpo-30263: regrtest: log system load (#1452) 3d0056842c5e06b4102f990b59ab3b607f932dd8 Victor Stinner 2017-05-04 13:21:12
bpo-29956: Improve the math.exp() related documentation. (#1073) dbaf746b6de0ee431c809d3175ab40ccc18898a8 Serhiy Storchaka 2017-05-04 09:25:09
bpo-30166: Import command-line parsing modules only when needed. (#1293) 7e4db2f253c555568d56177c2fd083bcf8f88d34 Serhiy Storchaka 2017-05-04 05:17:47
bpo-30225: Fix is_valid_fd() on macOS Tiger (#1443) 1c4670ea0cc3d208121af11b9b973e6bb268e570 Victor Stinner 2017-05-03 22:45:56
bpo-30184: Add tests for invalid use of PyArg_ParseTupleAndKeywords. (#1316) 5f161fd86dd5bb936a1a2a13391b13b7e59ec201 Serhiy Storchaka 2017-05-03 21:03:23
Add myself to mention-bot's alwaysNotifyForPaths for ssl/hashlib (#1425) feec3dc9c308052754f9e4848c1c1ddb007e9f66 Christian Heimes 2017-05-03 18:17:54
Explicitly mention what should (not) be discussed on GitHub (GH-1437) 7fdd30975e3fa9ec4be62464a9fcab7798d0ed6e Brett Cannon 2017-05-03 17:51:55
bpo-28315: Improve code examples in docs (GH-1372) 8856940cf2e82cb17db2b684cd5732fe658605ca UltimateCoder 2017-05-03 16:46:45
bpo-23404: make touch becomes make regen-all (#1405) a5c62a8e9f0de6c4133825a5710984a3cd5e102b Victor Stinner 2017-05-03 16:21:48
Commit a12df7b7d40dbf47825917c8fa03d2c09b5a382c - bpo-30218: support path-like objects in shutil.unpack_archive() (GH-1367)
Thanks to Jelle Zijlstra for the patch.
Author: Jelle Zijlstra
Author date (UTC): 2017-05-05 21:27
Committer name: Brett Cannon
Committer date (UTC): 2017-05-05 21:27
Parent(s): a1054c3b0037d4c2a5492e79fc193f36245366c7
Signing key:
Tree: ad818268e3f1adb56743292245eac64c8ce9be20
File Lines added Lines deleted
Doc/library/shutil.rst 3 0
Lib/shutil.py 3 0
Lib/test/test_shutil.py 17 4
Misc/NEWS 3 0
File Doc/library/shutil.rst changed (mode: 100644) (index 41e5bafa53..2b84fa2937)
... ... provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules.
550 550 registered for that extension. In case none is found, registered for that extension. In case none is found,
551 551 a :exc:`ValueError` is raised. a :exc:`ValueError` is raised.
552 552
553 .. versionchanged:: 3.7
554 Accepts a :term:`path-like object` for *filename* and *extract_dir*.
555
553 556
554 557 .. function:: register_unpack_format(name, extensions, function[, extra_args[, description]]) .. function:: register_unpack_format(name, extensions, function[, extra_args[, description]])
555 558
File Lib/shutil.py changed (mode: 100644) (index 31536fe632..464ee912f5)
... ... def unpack_archive(filename, extract_dir=None, format=None):
958 958 if extract_dir is None: if extract_dir is None:
959 959 extract_dir = os.getcwd() extract_dir = os.getcwd()
960 960
961 extract_dir = os.fspath(extract_dir)
962 filename = os.fspath(filename)
963
961 964 if format is not None: if format is not None:
962 965 try: try:
963 966 format_info = _UNPACK_FORMATS[format] format_info = _UNPACK_FORMATS[format]
File Lib/test/test_shutil.py changed (mode: 100644) (index c7f7d1d3e6..f21e6adf4a)
... ... import os
10 10 import os.path import os.path
11 11 import errno import errno
12 12 import functools import functools
13 import pathlib
13 14 import subprocess import subprocess
14 15 from shutil import (make_archive, from shutil import (make_archive,
15 16 register_archive_format, unregister_archive_format, register_archive_format, unregister_archive_format,
 
... ... class TestShutil(unittest.TestCase):
1223 1224 self.assertNotIn('xxx', formats) self.assertNotIn('xxx', formats)
1224 1225
1225 1226 def check_unpack_archive(self, format): def check_unpack_archive(self, format):
1227 self.check_unpack_archive_with_converter(format, lambda path: path)
1228 self.check_unpack_archive_with_converter(format, pathlib.Path)
1229
1230 class MyPath:
1231 def __init__(self, path):
1232 self.path = path
1233 def __fspath__(self):
1234 return self.path
1235
1236 self.check_unpack_archive_with_converter(format, MyPath)
1237
1238 def check_unpack_archive_with_converter(self, format, converter):
1226 1239 root_dir, base_dir = self._create_files() root_dir, base_dir = self._create_files()
1227 1240 expected = rlistdir(root_dir) expected = rlistdir(root_dir)
1228 1241 expected.remove('outer') expected.remove('outer')
 
... ... class TestShutil(unittest.TestCase):
1232 1245
1233 1246 # let's try to unpack it now # let's try to unpack it now
1234 1247 tmpdir2 = self.mkdtemp() tmpdir2 = self.mkdtemp()
1235 unpack_archive(filename, tmpdir2)
1248 unpack_archive(converter(filename), converter(tmpdir2))
1236 1249 self.assertEqual(rlistdir(tmpdir2), expected) self.assertEqual(rlistdir(tmpdir2), expected)
1237 1250
1238 1251 # and again, this time with the format specified # and again, this time with the format specified
1239 1252 tmpdir3 = self.mkdtemp() tmpdir3 = self.mkdtemp()
1240 unpack_archive(filename, tmpdir3, format=format)
1253 unpack_archive(converter(filename), converter(tmpdir3), format=format)
1241 1254 self.assertEqual(rlistdir(tmpdir3), expected) self.assertEqual(rlistdir(tmpdir3), expected)
1242 1255
1243 self.assertRaises(shutil.ReadError, unpack_archive, TESTFN)
1244 self.assertRaises(ValueError, unpack_archive, TESTFN, format='xxx')
1256 self.assertRaises(shutil.ReadError, unpack_archive, converter(TESTFN))
1257 self.assertRaises(ValueError, unpack_archive, converter(TESTFN), format='xxx')
1245 1258
1246 1259 def test_unpack_archive_tar(self): def test_unpack_archive_tar(self):
1247 1260 self.check_unpack_archive('tar') self.check_unpack_archive('tar')
File Misc/NEWS changed (mode: 100644) (index 25619efddf..0c403cb0cf)
... ... Library
362 362 Fixed possible other errors caused by not checking results of PyObject_Size(), Fixed possible other errors caused by not checking results of PyObject_Size(),
363 363 PySequence_Size(), or PyMapping_Size(). PySequence_Size(), or PyMapping_Size().
364 364
365 - bpo-30218: Fix PathLike support for shutil.unpack_archive. Patch by Jelle
366 Zijlstra.
367
365 368 - bpo-10076: Compiled regular expression and match objects in the re module - bpo-10076: Compiled regular expression and match objects in the re module
366 369 now support copy.copy() and copy.deepcopy() (they are considered atomic). now support copy.copy() and copy.deepcopy() (they are considered atomic).
367 370
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/benf_wspdigital/cpython

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/benf_wspdigital/cpython

Clone this repository using git:
git clone git://git.rocketgit.com/user/benf_wspdigital/cpython

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main