Title: compileall no longer warns when cli arguments name non-existent files
Type: behavior Stage: resolved
Components: Versions: Python 3.2
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: r.david.murray
Priority: low Keywords: easy, patch

Created on 2010-12-16 15:51 by r.david.murray, last changed 2010-12-16 19:16 by r.david.murray. This issue is now closed.

File name Uploaded Description Edit
compileall_bad_args.patch r.david.murray, 2010-12-16 19:16
Messages (2)
msg124136 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-12-16 15:51
The introduction of support for compiling individual files broke the previous behavior of compileall, where it would report that it could not turn a directory name into a file list if the named directory did not exist.

A fix would be to reverse the test used to determine whether or not to call compile_file: instead of calling it if the name is not a directory, we should call it if the name is a file, and pass everything else to compile_dir.  This would restore the previous behaviour.

Note that compileall considers not finding a named file/directory as successful compilation, so this is a low priority bug.
msg124155 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-12-16 19:16
Fixed in r87324.  I've also added a test for the behaviour when no arguments are given, since that wasn't tested before, and removed the sys.path fiddling since it has no effect on subprocess runs.  Oh, and fixed a bug in one of the other tests.

I did not back port this to 2.7.  The tests aren't there, and the risk of breakage seems higher than the benefit of this non-semantic change, for a point release.
Date User Action Args
2010-12-16 19:16:49r.david.murraysetstatus: open -> closed
files: + compileall_bad_args.patch

versions: - Python 2.7
keywords: + patch
resolution: fixed
messages: + msg124155
stage: test needed -> resolved
2010-12-16 15:51:59r.david.murraycreate