cpython/Lib
Éric Araujo a7e33a10ae Clean up test_shutil, to facilitate upcoming improvements (#12721).
The tests now have two convenience functions to wrap os.path.join, open
and read or write instead of four or six slightly different functions.
The new functions accept a tuple of path segments but not a list
anymore, as it makes no sense to use a list here; I have also removed
the default value for the contents in write_file, as I find it better to
have the contents at the call site.

For simple open then read/write calls, I have left the usual idiom (with
open + read/write), as it is short and readable enough.

I’ve also changed some convoluted cleanup code to just use rmtree, and
removed dubious LBYL os.path.exists checks.  The tests still pass on my
machine, and leave no file in $TMP.  test_shutil is not as clean as it
could be, but I’ll stop here.

Initial patch provided by Hynek Schlawack, in preparation for a new
feature with new tests in #12715.
2011-08-12 19:51:35 +02:00
..
collections Add support for unary plus and unary minus to collections.Counter() 2011-08-09 13:00:40 -07:00
concurrent Close the call queue in concurrent.futures.ProcessPoolExecutor when 2011-07-16 23:52:02 +02:00
ctypes merge 3.2 2011-07-13 23:11:14 -05:00
curses merge from 3.2 - Fix closes Issue11439 Remove the SVN keywords from the code as it is no longer applicable in hg. Patch Contributed by Neil Muller. 2011-07-28 23:39:08 +08:00
dbm Merge 3.1 2011-04-20 19:24:09 +02:00
distutils Revert cosmetic change. 2011-08-10 02:46:33 +02:00
email #665194: support roundtripping RFC2822 date stamps in the email.utils module 2011-07-20 11:41:21 -04:00
encodings Issue #10807: Remove base64, bz2, hex, quopri, rot13, uu and zlib codecs from 2011-01-02 19:50:36 +00:00
html Merge 3.1 2011-05-25 18:13:49 +02:00
http Merge with 3.2. 2011-08-03 08:29:12 +02:00
idlelib Issue #12540: Prevent zombie IDLE processes on Windows due to changes 2011-08-04 23:38:19 -07:00
importlib Closes #12291 for 3.3 - merged fix from 3.2. 2011-07-02 17:16:02 +01:00
json #5723: merge with 3.1. 2011-05-14 06:47:51 +03:00
lib2to3 Merge fixes for #9860, #11104/#8688 and #12331 from 3.2 2011-07-31 18:33:00 +02:00
logging Fixes #12637: Merged fix from 3.2 and added test. 2011-07-25 19:58:13 +01:00
msilib merge #11696 2011-03-27 21:07:13 +02:00
multiprocessing Remove indirection in threading (issue #10968). 2011-07-28 00:28:28 +02:00
packaging Use our existing drop-in, no-op decorator instead of redefining it. 2011-08-12 00:15:41 +02:00
plat-aix4 Rip out 'long' and 'L'-suffixed integer literals. 2007-01-15 16:59:06 +00:00
plat-darwin These are present in the trunk but no longer in 3.x, which causes problems 2009-03-04 23:21:07 +00:00
plat-freebsd4 Merged revisions 78644 via svnmerge from 2010-03-04 02:11:41 +00:00
plat-freebsd5 Merged revisions 78644 via svnmerge from 2010-03-04 02:11:41 +00:00
plat-freebsd6 Merged revisions 78644 via svnmerge from 2010-03-04 02:11:41 +00:00
plat-freebsd7 Merged revisions 78644 via svnmerge from 2010-03-04 02:11:41 +00:00
plat-freebsd8 Merged revisions 78644 via svnmerge from 2010-03-04 02:11:41 +00:00
plat-generic
plat-linux2 Rip out 'long' and 'L'-suffixed integer literals. 2007-01-15 16:59:06 +00:00
plat-linux3 Issue #12571: Add a plat-linux3 directory mirroring the plat-linux2 directory, 2011-07-20 00:26:23 +02:00
plat-netbsd1
plat-next3
plat-os2emx Merged revisions 78644 via svnmerge from 2010-03-04 02:11:41 +00:00
plat-sunos5 Merged revisions 78678,78680,78682 via svnmerge from 2010-03-05 03:33:11 +00:00
plat-unixware7 Merged revisions 55817-55961 via svnmerge from 2007-06-13 18:07:49 +00:00
pydoc_data Update pydoc topics. 2011-07-03 09:31:04 +02:00
site-packages
sqlite3 Issue #10811: Use TestCase.assertRaises() in the new test 2011-05-09 12:50:41 +02:00
test Clean up test_shutil, to facilitate upcoming improvements (#12721). 2011-08-12 19:51:35 +02:00
tkinter Issue #8716: Instead of relying on Aqua Tk exceptions to detect lack of 2011-07-05 19:11:15 -07:00
turtledemo #12677: correct turtle orientation in doc 2011-08-07 17:12:19 +02:00
unittest test that TestCase doesn't get cycles 2011-07-14 12:48:25 -05:00
urllib merge from 3.2 - Fix closes issue12698 - make the no_proxy environment variable handling a bit lenient (accomodate spaces in between the items) 2011-08-06 12:28:16 +08:00
wsgiref Merged revisions 87797 via svnmerge from 2011-01-06 17:18:32 +00:00
xml (merge 3.2) Issue #12451: xml.dom.pulldom: parse() now opens files in binary 2011-07-04 01:27:37 +02:00
xmlrpc #11565: Merge with 3.1. 2011-03-16 11:35:38 +02:00
__future__.py barry has already been causing test breakage 2009-04-01 20:38:13 +00:00
__phello__.foo.py
_compat_pickle.py Issue #6137: The pickle module now translates module names when loading 2009-06-04 20:32:06 +00:00
_dummy_thread.py Issue #11223: Replace threading._info() by sys.thread_info 2011-04-30 14:53:09 +02:00
_markupbase.py Take advantage of the frozenset constant optimization. 2010-09-05 23:15:06 +00:00
_pyio.py Issue #12591: Allow io.TextIOWrapper to work with raw IO objects (without 2011-07-23 21:50:21 +02:00
_strptime.py PEP 8 conformance: class_ -> cls 2010-07-14 13:46:57 +00:00
_threading_local.py Issue #9707: Rewritten reference implementation of threading.local which 2010-09-07 22:06:17 +00:00
_weakrefset.py Merged revisions 86537,86867-86868,86881,86887,86913-86915,86931-86933,86960,86964,86974,86980,86996,87008,87050 via svnmerge from 2011-02-25 09:48:21 +00:00
abc.py Allow usage of SomeABC.register as a class decorator. Patch by Edoardo Spadolini (#10868). 2011-02-24 18:03:10 +00:00
aifc.py Merged revisions 72425-72426 via svnmerge from 2009-05-07 18:24:38 +00:00
antigravity.py Another hidden treasure. 2009-06-03 17:21:17 +00:00
argparse.py #10424: argument names are now included in the missing argument message 2011-06-09 12:34:07 -04:00
ast.py remove ast.__version__ (closes #12273) 2011-07-15 21:10:13 -05:00
asynchat.py Normalize the encoding names for Latin-1 and UTF-8 to 2011-02-25 15:42:01 +00:00
asyncore.py Merge - Issue #12502: asyncore: fix polling loop with AF_UNIX sockets. 2011-07-14 20:00:49 +02:00
base64.py #1466065: add validate option to base64.b64decode 2010-11-11 20:09:20 +00:00
bdb.py Issue #10492: bdb.Bdb.run() only traces the execution of the code 2011-01-06 00:49:38 +00:00
binhex.py remove unused imports (closes #12432) 2011-06-28 10:25:04 -05:00
bisect.py Per the language summit, the optional fastpath imports should use from-import-star. 2009-03-31 17:51:51 +00:00
bz2.py Miscellaneous cleanups to bz2 and test_bz2 following issue #1625. 2011-05-30 01:12:24 +02:00
calendar.py Fix closes Issue10087 - fixing the output of calendar display in the html format. Patch by Chris Lambacher. Test Contributed by catherine. 2011-08-11 09:22:52 +08:00
cgi.py Add cgi.closelog() function to close the log file 2011-07-14 22:28:36 +02:00
cgitb.py remove unused imports (closes #12432) 2011-06-28 10:25:04 -05:00
chunk.py Raise statement normalization in Lib/. 2007-08-30 01:19:48 +00:00
cmd.py Add docstring to cmd.Cmd.do_help() 2010-09-09 03:53:22 +00:00
code.py Merged revisions 75264,75268,75293,75318,75391-75392,75436,75478,75971,76003,76058,76140-76141,76231,76380,76428-76429 via svnmerge from 2009-11-25 17:46:26 +00:00
codecs.py Revert my commit 3555cf6f9c98: "Issue #8796: codecs.open() calls the builtin 2011-05-27 16:50:40 +02:00
codeop.py Merged revisions 75472 via svnmerge from 2009-10-18 00:34:08 +00:00
colorsys.py Merged revisions 68884,68973,68978,69003,69083,69112-69113 via svnmerge from 2009-01-30 03:39:35 +00:00
compileall.py Issue #11169: compileall module uses repr() to format filenames and paths to 2011-05-11 00:36:28 +02:00
configparser.py Merged minor cleanups from 3.2. 2011-04-29 16:17:51 +02:00
contextlib.py remove unused imports (closes #12432) 2011-06-28 10:25:04 -05:00
copy.py #11572: improvements to copy module tests along with removal of old test suite 2011-08-05 23:05:35 +02:00
copyreg.py Rename copy_reg module to copyreg. 2008-05-11 08:55:36 +00:00
cProfile.py Merged revisions 82805-82806,83523-83527,83536,83538,83542,83546-83548,83550-83555,83558,83560 via svnmerge from 2010-10-06 08:26:09 +00:00
crypt.py A crypt algorithm may not be available by returning None. 2011-02-22 21:55:51 +00:00
csv.py #11565: Merge with 3.1. 2011-03-16 11:35:38 +02:00
datetime.py Issue #11930: Remove year >= 1000 limitation from datetime.strftime. 2011-05-02 13:14:24 -04:00
decimal.py Issue #12080: Fix a performance issue in Decimal._power_exact that causes some corner-case Decimal.__pow__ calls to take an unreasonably long time. 2011-06-04 18:14:23 +01:00
difflib.py Issue 11747: Fix output format for context diffs. 2011-04-12 15:25:30 -07:00
dis.py As per python-dev discussion with Eli, properly document and publish dis.show_code 2010-09-10 14:08:04 +00:00
doctest.py (merge 3.2) Issue #12451: doctest.debug_script() doesn't create a temporary 2011-06-30 17:39:17 +02:00
dummy_threading.py Rename thread to _thread and dummy_thread to _dummy_thread. Issue #2875. 2008-05-25 13:05:15 +00:00
filecmp.py Issue 11802: filecmp cache was growing without bound. 2011-06-25 17:20:21 +02:00
fileinput.py #1286: allow using fileinput.FileInput as context manager. 2010-07-31 20:08:15 +00:00
fnmatch.py Re-apply r83871. 2010-08-13 16:26:40 +00:00
formatter.py Fix formatter usage of filter(). Bug #3800. 2008-09-09 19:31:25 +00:00
fractions.py Make Fraction(-1).__hash__() return -2 rather than -1 (see issue 10356). 2010-11-13 10:27:38 +00:00
ftplib.py Merge: #10883: Fix socket leaks in urllib.request. 2011-07-23 14:25:45 +02:00
functools.py Sync-up minor code edits with the default branch. 2011-05-05 14:15:12 -07:00
genericpath.py Merged revisions 78018,78035-78040,78042-78043,78046,78048-78052,78054,78059,78075-78080 via svnmerge from 2010-03-14 10:23:39 +00:00
getopt.py Issue #11621: fix bootstrap issue with getopt/gettext (following d3e46930ffe9) 2011-03-21 16:04:06 +01:00
getpass.py Fix for issue11236 getpass.getpass to respond ctrl-c or ctrl-z 2011-04-26 20:59:46 +08:00
gettext.py #11515: Merge with 3.1. 2011-03-15 05:59:46 +02:00
glob.py Fix closes issue12432 - remove the unused sys from glob.py 2011-07-03 17:21:05 -07:00
gzip.py Remove dead code in gzip. 2011-04-13 18:57:40 +02:00
hashlib.py fix whitespace 2011-05-14 15:35:56 -07:00
heapq.py Merge 3.1 2011-04-20 19:24:09 +02:00
hmac.py speed hack can be implemented more cleanly by directly calling __new__ 2010-08-21 02:45:15 +00:00
imaplib.py Issue #1441530: In imaplib, read the data in one chunk to speed up large 2011-05-24 23:47:49 +02:00
imghdr.py Merged revisions 65713 via svnmerge from 2008-08-16 16:48:16 +00:00
inspect.py remove unused imports (closes #12432) 2011-06-28 10:25:04 -05:00
io.py add myself 2009-05-01 20:45:43 +00:00
keyword.py Use a context manager for some file objects. 2010-09-03 19:52:03 +00:00
linecache.py Issue #10335: Add tokenize.open(), detect the file encoding using 2010-11-09 01:08:59 +00:00
locale.py (merge) Fix #10154 and #10090: locale normalizes the UTF-8 encoding to "UTF-8" instead of "UTF8" 2011-05-17 13:03:54 +02:00
macpath.py Issue #767645: Set os.path.supports_unicode_filenames to True on Mac OS X 2010-09-13 19:41:36 +00:00
macurl2path.py Fixing Issue6711 - macurl2path has typos that raise AttributeError 2009-08-16 06:44:28 +00:00
mailbox.py #11700: proxy object close methods can now be called multiple times 2011-06-17 22:24:05 -04:00
mailcap.py Merged revisions 80368-80369 via svnmerge from 2010-04-22 13:56:42 +00:00
mimetypes.py Fix syntax typo 2010-12-23 23:18:41 +00:00
modulefinder.py Fix bug I unwittingly added in 1521d9837d16 (found by Ezio Melotti) 2011-08-01 15:29:07 +02:00
netrc.py fix regression in netrc comment handling (closes #12009) 2011-06-10 11:32:52 -05:00
nntplib.py #11515: Merge with 3.1. 2011-03-15 05:59:46 +02:00
ntpath.py Correction to 88e318166eaf - Issue #11583 2011-06-09 09:10:38 -05:00
nturl2path.py Fix Issue11474 - fix url2pathname() handling of '/C|/' on Windows 2011-04-14 13:16:30 +08:00
numbers.py Remove the funky function annotation from numbers.py. 2011-01-12 20:54:53 +00:00
opcode.py excise the remains of STOP_CODE, which hasn't done anything useful for years 2011-07-17 22:49:50 -05:00
optparse.py Merge #8158: add missing 'description' description to optparse docstring. 2011-05-04 21:08:07 -04:00
os.py Issue #11459: A bufsize value of 0 in subprocess.Popen() really creates 2011-03-19 17:04:13 +01:00
os2emxpath.py #9018: os.path.normcase() now raises a TypeError if the argument is not str or bytes. 2010-06-25 10:56:11 +00:00
pdb.py Add display/undisplay pdb commands. 2010-12-04 16:21:42 +00:00
pickle.py remove __version__s dependent on subversion keyword expansion (closes #12221) 2011-05-31 20:52:17 -05:00
pickletools.py #11565: Merge with 3.1. 2011-03-16 11:35:38 +02:00
pipes.py Add shlex.quote function, to escape filenames and command lines (#9723). 2011-07-27 18:29:31 +02:00
pkgutil.py Merge 3.2 2011-05-25 18:22:26 +02:00
platform.py Issue #12549: Correct test_platform to not fail when OS X returns 'x86_64' 2011-07-13 15:09:49 -07:00
plistlib.py Issue #12452: Plist and Dict are now deprecated 2011-07-04 14:28:45 +02:00
poplib.py Issue 11291: poplib suppresses errors on QUIT. 2011-02-25 22:28:24 +00:00
posixpath.py Merged revisions 85689 via svnmerge from 2010-10-18 13:49:09 +00:00
pprint.py Have pprint() respect the order in an OrderedDict. 2010-09-09 12:31:00 +00:00
profile.py strip trailing ws 2011-06-27 09:18:46 -05:00
pstats.py Merge profile docs followup (#12417) from 3.1 2011-07-28 23:00:14 +02:00
pty.py Issue #3782: os.write() must not accept unicode strings 2008-09-15 23:02:56 +00:00
py_compile.py Add an "optimize" parameter to compile() to control the optimization level, and provide an interface to it in py_compile, compileall and PyZipFile. 2010-12-04 10:26:46 +00:00
pyclbr.py Issue 11020: command-line pyclbr broken due to missing 2-to-3 conversion. 2011-01-27 00:12:08 +00:00
pydoc.py Merge fix for #8887 from 3.2 2011-07-29 17:38:23 +02:00
queue.py Issue 10110: Let Queue.put recognize a full queue when the maxsize parameter has been reduced. 2010-10-31 17:57:52 +00:00
quopri.py convert shebang lines: python -> python3 2010-03-11 22:53:45 +00:00
random.py Code simplification suggested by Sven Marnach. 2011-06-25 11:31:46 +02:00
re.py #2650: re.escape() no longer escapes the "_". 2011-04-10 12:59:16 +03:00
reprlib.py Close #12028: Make threading._get_ident() public, rename it to 2011-05-30 23:02:52 +02:00
rlcompleter.py Merged revisions 65168 via svnmerge from 2008-07-21 16:32:10 +00:00
runpy.py Issue #12451: runpy: run_path() now opens the Python script in binary mode, 2011-07-04 01:45:39 +02:00
sched.py Merged revisions 72932 via svnmerge from 2009-05-26 07:51:03 +00:00
shelve.py #7905: Actually respect the keyencoding parameter to shelve.Shelf. 2010-12-04 11:12:43 +00:00
shlex.py Avoid unwanted behavior change in shlex.quote (see #9723). 2011-08-09 23:18:06 +02:00
shutil.py Remove unused names in except clauses 2011-08-10 20:54:33 +02:00
site.py Replace open(filename, 'rU') by open(filename, 'r') 2011-05-04 13:55:36 +02:00
smtpd.py Normalize the encoding names for Latin-1 and UTF-8 to 2011-02-25 15:42:01 +00:00
smtplib.py Addressing the review comments by Antoine Pitrou for smtplib.py and test_smtplib.py. Review comments by Ezio Melotti for smtplib.rst 2011-07-31 09:14:17 +08:00
sndhdr.py Merged revisions 82856-82857 via svnmerge from 2010-07-13 23:19:20 +00:00
socket.py Issue #11127: Raise a TypeError when trying to pickle a socket object. 2011-03-20 23:56:36 +01:00
socketserver.py Fix closes issue #11109 - socketserver.ForkingMixIn leaves zombies, also fails to reap all zombies in one pass. 2011-05-26 00:22:59 +08:00
sre_compile.py Issue #8990: array.fromstring() and array.tostring() get renamed to 2010-09-01 20:29:34 +00:00
sre_constants.py #2834: Change re module semantics, so that str and bytes mixing is forbidden, 2008-08-19 17:56:33 +00:00
sre_parse.py Normalize the encoding names for Latin-1 and UTF-8 to 2011-02-25 15:42:01 +00:00
ssl.py Issue #12551: Provide a get_channel_binding() method on SSL sockets so as 2011-07-21 01:11:30 +02:00
stat.py Issue #8746: Correct faulty configure checks so that os.chflags() and 2011-06-28 00:00:28 -07:00
string.py Issue #11297: Add collections.ChainMap() 2011-02-26 01:02:51 +00:00
stringprep.py Merged revisions 55007-55179 via svnmerge from 2007-05-07 22:24:25 +00:00
struct.py Issue #11081: Fixed struct.__all__. Reviewed by Georg Brandl. 2011-01-31 19:27:55 +00:00
subprocess.py Issue #12607: In subprocess, fix issue where if stdin, stdout or stderr is 2011-07-27 07:16:31 +02:00
sunau.py Issue #10265: Close file objects explicitly in sunau. Patch by Brian Brazil. 2010-10-31 21:27:04 +00:00
symbol.py convert shebang lines: python -> python3 2010-03-11 22:53:45 +00:00
symtable.py simplify this expression 2009-06-28 19:30:36 +00:00
sysconfig.cfg Update comments in sysconfig.cfg 2011-06-06 20:07:04 +02:00
sysconfig.py Branch merge 2011-05-26 16:35:14 +02:00
tabnanny.py #1513299: cleanup some map() uses where a comprehension works better. 2010-12-04 10:39:14 +00:00
tarfile.py merge from 3.2 - Fix closes Issue11439 Remove the SVN keywords from the code as it is no longer applicable in hg. Patch Contributed by Neil Muller. 2011-07-28 23:39:08 +08:00
telnetlib.py Merged revisions 87230 via svnmerge from 2010-12-14 14:27:27 +00:00
tempfile.py Issue #12464: tempfile.TemporaryDirectory.cleanup() should not follow symlinks: 2011-07-29 19:00:38 +02:00
textwrap.py merge from 3.2 - Fix closes Issue11439 Remove the SVN keywords from the code as it is no longer applicable in hg. Patch Contributed by Neil Muller. 2011-07-28 23:39:08 +08:00
this.py Fix most trivially-findable print statements. 2007-02-09 05:37:30 +00:00
threading.py add ThreadError to threading.__all__ (closes #12679) 2011-08-02 13:05:47 -05:00
timeit.py Issue 12514: Use try/finally to assure that timeit restores GC when done. 2011-07-29 00:08:19 -07:00
token.py Issue #10386: Added __all__ to token module; this simplifies importing 2010-11-11 14:07:41 +00:00
tokenize.py Merged revisions 88498 via svnmerge from 2011-02-22 03:35:18 +00:00
trace.py Prevent deprecation warning 2011-04-17 16:48:52 +02:00
traceback.py Merged revisions 76573 via svnmerge from 2009-11-28 16:16:09 +00:00
tty.py
turtle.py #12677: merge with 3.2 2011-08-07 17:13:13 +02:00
types.py Merged revisions 62194,62197-62198,62204-62205,62214,62219-62221,62227,62229-62231,62233-62235,62237-62239 via svnmerge from 2008-04-09 08:37:03 +00:00
uu.py Merged revisions 86037 via svnmerge from 2010-10-31 16:06:55 +00:00
uuid.py Merged revisions 86192 via svnmerge from 2010-11-05 14:52:43 +00:00
warnings.py Add a new warning gategory, ResourceWarning, as discussed on python-dev. It is silent by default, 2010-10-24 15:11:22 +00:00
wave.py Issue #10783: struct.pack() doesn't encode implicitly unicode to UTF-8 2010-12-28 13:26:42 +00:00
weakref.py Use booleans. 2010-12-03 07:49:09 +00:00
webbrowser.py #12601: fix typo. 2011-07-21 11:16:32 +03:00
xdrlib.py Issue #9696: Fix exception incorrectly raised by xdrlib.Packer.pack_int when trying to pack a negative (in-range) integer. 2011-03-27 16:25:40 +01:00
zipfile.py #10694: zipfile now ignores garbage at the end of a zipfile. 2011-06-09 15:50:51 -04:00