Antoine Pitrou
492b9893e1
Fix DeprecationWarnings in test suite
2013-12-21 22:19:46 +01:00
Victor Stinner
1d006a2c0e
Backout a1a05e2724dd: shutil.which(bytes) is a new feature and my patch does not work on Windows
2013-12-16 23:39:40 +01:00
Victor Stinner
fffb96ba66
Issue #18283 : shutil.which() now supports bytes argument, not only text argument.
2013-12-16 22:48:48 +01:00
Zachary Ware
101d9e7250
Issue 19572: More silently skipped tests explicitly skipped.
2013-12-08 00:44:27 -06:00
Zachary Ware
9fe6d86709
Issue 19572: More silently skipped tests explicitly skipped.
2013-12-08 00:20:35 -06:00
Serhiy Storchaka
43767638a9
Issue #18702 : All skipped tests now reported as skipped.
2013-11-03 21:31:38 +02:00
Serhiy Storchaka
7908068627
Issue #18702 : All skipped tests now reported as skipped.
2013-11-03 21:31:18 +02:00
Brett Cannon
9c7eb55570
Stop using assertEquals.
2013-08-23 14:38:11 -04:00
Antoine Pitrou
566c470e3e
Issue #1666318 : Add a test that shutil.copytree() retains directory permissions.
...
Patch by Catherine Devlin.
2013-08-16 19:36:18 +02:00
Antoine Pitrou
ac601601ce
Issue #1666318 : Add a test that shutil.copytree() retains directory permissions.
...
Patch by Catherine Devlin.
2013-08-16 19:35:02 +02:00
Nick Coghlan
cf67b2a891
Merge #15415 from 3.3
2013-07-28 22:25:25 +10:00
Nick Coghlan
5517596c04
Close #15415 : Factor out temp dir helpers to test.support
...
Patch by Chris Jerdonek
2013-07-28 22:11:50 +10:00
Brett Cannon
3e9a9ae09d
Update various test modules to use unittest.main() for test discovery
...
instead of manually listing tests for test.support.run_unittest().
2013-06-12 21:25:59 -04:00
Serhiy Storchaka
12516e2c1b
Issue #17746 : Skip test_shutil.test_non_matching_mode when run as root or
...
on unsuitable platform/environment.
2013-05-28 15:50:15 +03:00
Serhiy Storchaka
5758fa78d0
Issue #17746 : Skip test_shutil.test_non_matching_mode when run as root or
...
on unsuitable platform/environment.
2013-05-28 15:53:46 +03:00
Barry Warsaw
99c56e8f58
Remove unused import
2013-04-16 11:19:11 -04:00
Barry Warsaw
20c08c8041
Remove unused import.
2013-04-16 11:18:53 -04:00
Barry Warsaw
ecaefcf44e
- Issue #17012 : shutil.which() no longer fallbacks to the PATH environment
...
variable if empty path argument is specified. Patch by Serhiy Storchaka.
2013-04-16 11:18:18 -04:00
Barry Warsaw
618738b921
- Issue #17012 : shutil.which() no longer fallbacks to the PATH environment
...
variable if empty path argument is specified. Patch by Serhiy Storchaka.
2013-04-16 11:05:03 -04:00
Hynek Schlawack
4cd7b9c3e9
#17076 : Make copying of xattrs more permissive of missing FS support
...
Patch by Thomas Wouters.
2013-02-05 08:25:24 +01:00
Hynek Schlawack
0beab058dd
#17076 : Make copying of xattrs more permissive of missing FS support
...
Patch by Thomas Wouters.
2013-02-05 08:22:44 +01:00
Serhiy Storchaka
dec4de235f
Fix pathext test for shutil.which() which was
...
broken after applying the patch for issue #16957 .
2013-01-24 20:04:37 +02:00
Serhiy Storchaka
d70127ac54
Fix pathext test for shutil.which() which was
...
broken after applying the patch for issue #16957 .
2013-01-24 20:03:49 +02:00
Serhiy Storchaka
e9a63600b3
Issue #16957 : shutil.which() no longer searches a bare file name in the
...
current directory on Unix and no longer searches a relative file path with
a directory part in PATH directories. Patch by Thomas Kluyver.
2013-01-23 10:45:33 +02:00
Serhiy Storchaka
8bea200b98
Issue #16957 : shutil.which() no longer searches a bare file name in the
...
current directory on Unix and no longer searches a relative file path with
a directory part in PATH directories. Patch by Thomas Kluyver.
2013-01-23 10:44:21 +02:00
Serhiy Storchaka
2ba095c6c5
Fix shutil.which() test for issue #16993 .
2013-01-22 10:32:16 +02:00
Serhiy Storchaka
80c88f4304
Fix shutil.which() test for issue #16993 .
2013-01-22 10:31:36 +02:00
Serhiy Storchaka
5b987c2e68
Issue #16993 : shutil.which() now preserves the case of the path and extension
...
on Windows.
2013-01-21 15:01:34 +02:00
Serhiy Storchaka
014791f848
Issue #16993 : shutil.which() now preserves the case of the path and extension
...
on Windows.
2013-01-21 15:00:27 +02:00
Andrew Svetlov
f7a17b48d7
Replace IOError with OSError ( #16715 )
2012-12-25 16:47:37 +02:00
Hynek Schlawack
6c722c6df4
#15872 : Some more Windows related tuning to shutil.rmtree tests
...
Turns out, the snakebite bots have also their peculiarities.
I'm really not proud of this stream of commits. :(
2012-12-10 16:35:16 +01:00
Hynek Schlawack
c474c4e749
#15872 : Some more Windows related tuning to shutil.rmtree tests
...
Turns out, the snakebite bots behave also their peculiarities.
I'm really not proud of this stream of commits. :(
2012-12-10 16:33:41 +01:00
Hynek Schlawack
87f9b46f15
#15872 : Some more Windows related tuning to shutil.rmtree tests
...
Turns out, the snakebite bots behave also their peculiarities.
I'm really not proud of this stream of commits. :(
2012-12-10 16:29:57 +01:00
Hynek Schlawack
99d28ce0cd
#15872 : Be flexible with appending *.* in shutil.rmtree test case
...
The Windows buildbots seem to be unable to agree whether they need them or not.
2012-12-10 12:05:45 +01:00
Hynek Schlawack
f29b4937f7
#15872 : Be flexible with appending *.* in shutil.rmtree test case
...
The Windows buildbots seem to be unable to agree whether they need them or not.
2012-12-10 12:02:26 +01:00
Hynek Schlawack
b9e9f3e70d
#15872 : Be flexible with appending *.* in shutil.rmtree test case
...
The Windows buildbots seem to be unable to agree whether they need them or not.
2012-12-10 12:01:28 +01:00
Hynek Schlawack
8ade268c6b
#15872 : More shutil test fixes for Windows
...
This one is different from 3.2 and 3.3. Windows ceased using *.* since 3.4
apparently.
2012-12-10 11:12:57 +01:00
Hynek Schlawack
9d5e0cca85
#15872 : More shutil test fixes for Windows
2012-12-10 11:08:59 +01:00
Hynek Schlawack
9a4a750673
#15872 : More shutil test fixes for Windows
2012-12-10 11:08:09 +01:00
Hynek Schlawack
8e5a8296cc
#15872 : Fix shutil.rmtree error tests for Windows
2012-12-10 10:10:40 +01:00
Hynek Schlawack
b57b094077
#15872 : Fix shutil.rmtree error tests for Windows
2012-12-10 10:08:41 +01:00
Hynek Schlawack
9e8ac56e35
#15872 : Fix shutil.rmtree error tests for Windows
2012-12-10 10:07:11 +01:00
Hynek Schlawack
ae9a9e9a2d
#15872 : Fix 3.3 regression introduced by the new fd-based shutil.rmtree
...
It caused rmtree to not ignore certain errors when ignore_errors was set.
Patch by Alessandro Moura and Serhiy Storchaka.
2012-12-10 09:15:23 +01:00
Hynek Schlawack
b550110f64
#15872 : Fix 3.3 regression introduced by the new fd-based shutil.rmtree
...
It caused rmtree to not ignore certain errors when ignore_errors was set.
Patch by Alessandro Moura and Serhiy Storchaka.
2012-12-10 09:11:25 +01:00
Hynek Schlawack
d16eacba48
#15872 : Add tests for a 3.3 regression in the new fd-based shutil.rmtree
...
It cause shutil.rmtree not ignore all errors. Also add a test ensuring that
rmtree fails when being called on a symlink. Patch by Serhiy Storchaka.
2012-12-10 09:00:09 +01:00
Hynek Schlawack
27ddb576f1
#1492704 : Ensure and document backward compatibility of the change
2012-10-28 13:59:27 +01:00
Hynek Schlawack
4865376c44
Closes #1492704 : Make shutil.copyfile() raise a distinct SameFileError
...
Patch by Atsuo Ishimoto.
2012-10-07 12:49:58 +02:00
Hynek Schlawack
26fe37dd3f
#1492704 : Backout and wait for 3.4
2012-07-19 21:41:02 +02:00
Hynek Schlawack
77d3283370
#1492704 : Make shutil.copyfile() raise a distinct SameFileError
...
Patch by Atsuo Ishimoto.
2012-07-19 20:23:49 +02:00
Hynek Schlawack
c2d481fbcd
#15238 : Fix xattr related shutil.copystat tests
...
- Loosen up test as Fedora has implicit xattrs
- Actually test the destination for xattrs
Should make Fedora buildbot green again.
2012-07-16 17:11:10 +02:00
Larry Hastings
b40380667c
Issue #15202 : Consistently use the name "follow_symlinks" for
...
new parameters in os and shutil functions. Patch by Serhiy Storchaka.
2012-07-15 10:57:38 -07:00
Larry Hastings
ad5ae0456e
- Issue #15238 : shutil.copystat now copies Linux "extended attributes".
2012-07-14 17:55:11 -07:00
Hynek Schlawack
d0f6e0a6e6
Check for all used fd-based functions in shutil.rmdir, closes #15218
2012-06-29 08:28:20 +02:00
Hynek Schlawack
a75cd1ce73
#4489 : Don't follow ever symlinks in rmtree
...
Also added several regression tests.
2012-06-28 12:07:29 +02:00
Larry Hastings
5b2f9c0aff
Issue #15817 : Bugfix: remove temporary directories test_shutil was leaving
...
behind.
2012-06-25 23:50:01 -07:00
Hynek Schlawack
3b52778c74
#4489 Make fd based rmtree work on bytes
2012-06-25 13:27:31 +02:00
Hynek Schlawack
cf343532a2
Remove debug output from test_shutil
2012-06-24 16:21:22 +02:00
Ned Deily
5fddf866d8
Issue #14662 : Prevent shutil failures on OS X when destination does not
...
support chflag operations. (Patch by Hynek Schlawack)
2012-05-10 17:21:23 -07:00
Senthil Kumaran
0c2dba5726
Fix closes issue issue12470 - check for utime for the skipUnless condition.
2011-07-03 18:21:38 -07:00
Ronald Oussoren
78349b06af
merge from 3.1
2011-05-06 10:57:22 +02:00
Ronald Oussoren
f51738b10e
Fix for issue 10684: Folders get deleted when trying to change case with shutil.move (case insensitive file systems only)
2011-05-06 10:23:04 +02:00
Nick Coghlan
8ed3cf3a4b
Close #11560 : Improve test coverage of shutil
2011-03-16 14:05:35 -04:00
Nick Coghlan
abf202d798
Close #11548 : Correctly handle format argument in shutil.unpack_archive
2011-03-16 13:52:20 -04:00
Brian Curtin
3b4499c5c7
Fix #9333 . The symlink function is always available now, raising OSError
...
when the user doesn't hold the symbolic link privilege rather than hiding it.
2010-12-28 14:31:47 +00:00
Georg Brandl
724d0895e8
Temporarily disable newly failing test for the release.
2010-12-05 07:51:39 +00:00
Hirokazu Yamamoto
2668145dbd
Now can reproduce the error on AMD64 Windows Server 2008
...
even where os.symlink is not supported.
2010-12-05 02:04:16 +00:00
Brian Curtin
52173d4959
Fix #9333 . Expose os.symlink on Windows only when usable.
...
In order to create symlinks on Windows, SeCreateSymbolicLinkPrivilege
is an account privilege that is required to be held by the user. Not only
must the privilege be enabled for the account, the activated privileges for
the currently running application must be adjusted to enable the requested
privilege.
Rather than exposing an additional function to be called prior to the user's
first os.symlink call, we handle the AdjustTokenPrivileges Windows API call
internally and only expose os.symlink when the privilege escalation was
successful.
Due to the change of only exposing os.symlink when it's available, we can
go back to the original test skipping methods of checking via `hasattr`.
2010-12-02 18:29:18 +00:00
Nick Coghlan
5b0eca116a
Issue #4489 : Rename the feature marker for the symlink resistant rmtree and store it as a function attribute
2012-06-24 16:43:06 +10:00
Antoine Pitrou
4f6e3f74fc
Avoid depending on directory iteration order in test_shutil
2012-06-23 22:05:11 +02:00
Antoine Pitrou
f3a166d799
Add debug output to test_shutil
2012-06-23 21:32:36 +02:00
Antoine Pitrou
2f8a75c7a7
Proper cleanup in test_shutil, even in case of error.
2012-06-23 21:28:15 +02:00
Hynek Schlawack
2100b42317
#4489 : Fix usage of fd-based functions to new api introduced earlier today
...
Also add an explicit test for safe implementation usage on supported platforms.
As a side effect, this commit adds a module-level attribute 'rmtree_is_safe'
which offers introspection whether the current rmtree implementation is safe
against symlink attacks.
2012-06-23 20:28:32 +02:00
Hynek Schlawack
67be92bed4
#4489 : Add a shutil.rmtree that isn't suspectible to symlink attacks
...
It is used automatically on platforms supporting the necessary os.openat() and
os.unlinkat() functions. Main code by Martin von Löwis.
2012-06-23 17:58:42 +02:00
Larry Hastings
90867a5aba
Issue #14626 : Fix buildbot issues on FreeBSD (AMD64). (Fingers crossed.)
2012-06-22 17:01:41 -07:00
Larry Hastings
9cf065cfdc
Issue #14626 : Large refactoring of functions / parameters in the os module.
...
Many functions now support "dir_fd" and "follow_symlinks" parameters;
some also support accepting an open file descriptor in place of of a path
string. Added os.support_* collections as LBYL helpers. Removed many
functions only previously seen in 3.3 alpha releases (often starting with
"f" or "l", or ending with "at"). Originally suggested by Serhiy Storchaka;
implemented by Larry Hastings.
2012-06-22 16:30:09 -07:00
Antoine Pitrou
07c24d13ed
Issue #444582 : shutil.which() respects relative paths.
2012-06-22 23:33:05 +02:00
Brian Curtin
c57a34577c
Fix #444582 . Add shutil.which function for finding programs on the system path.
2012-06-22 16:00:30 -05:00
Brian Curtin
0d0a1dedbc
Fix #14772 : Return the destination from some shutil functions.
2012-06-18 18:41:07 -05:00
Antoine Pitrou
61597d3e92
Try to fix test_shutil failure under Fedora - patch by Hynek.
2012-05-12 23:37:35 +02:00
Antoine Pitrou
424246fbf3
Issue #14082 : shutil.copy2() now copies extended attributes, if possible.
...
Patch by Hynek Schlawack.
2012-05-12 19:02:01 +02:00
Ned Deily
baf75713c7
Issue #14662 : Prevent shutil failures on OS X when destination does not
...
support chflag operations. (Patch by Hynek Schlawack)
2012-05-10 17:05:19 -07:00
Antoine Pitrou
cfade36227
Relax tests to fix buildbot failure
2012-02-08 23:48:59 +01:00
Antoine Pitrou
bcf2b59fb5
Issue #13609 : Add two functions to query the terminal size:
...
os.get_terminal_size (low level) and shutil.get_terminal_size (high level).
Patch by Zbigniew Jędrzejewski-Szmek.
2012-02-08 23:28:36 +01:00
Antoine Pitrou
0a08d7a095
Issue #9993 : When the source and destination are on different filesystems,
...
and the source is a symlink, shutil.move() now recreates a symlink on the
destination instead of copying the file contents.
Patch by Jonathan Niehof and Hynek Schlawack.
2012-01-06 20:16:19 +01:00
Antoine Pitrou
c041ab6c7d
Mock the rename failure a bit better
2012-01-02 19:18:02 +01:00
Antoine Pitrou
78091e63d6
Issue #12715 : Add an optional symlinks argument to shutil functions (copyfile, copymode, copystat, copy, copy2).
...
When that parameter is true, symlinks aren't dereferenced and the operation
instead acts on the symlink itself (or creates one, if relevant).
Patch by Hynek Schlawack.
2011-12-29 18:54:15 +01:00
Sandro Tosi
91f948a734
#12191 : fix build failures, explicitly passing group argument when I want to test it
2011-08-22 23:55:39 +02:00
Sandro Tosi
d902a14dd0
#12191 : add shutil.chown() to change user and/or group owner of a given path also specifying their names.
2011-08-22 23:28:27 +02:00
É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
Senthil Kumaran
cc78c443f2
merge from 3.2
2011-07-03 18:22:14 -07:00
Éric Araujo
2ee61884fe
Clean up NEWS entry and tests for shutil.disk_usage ( #12442 )
2011-07-02 16:45:45 +02:00
Giampaolo Rodola'
210e7ca032
Issue #12442 : add shutil.disk_usage()
2011-07-01 13:55:36 +02:00
Victor Stinner
bf816223df
Issue #12451 : Add support.create_empty_file()
...
We don't need to create a temporary buffered binary or text file object just to
create an empty file.
Replace also os.fdopen(handle).close() by os.close(handle).
2011-06-30 23:25:47 +02:00
Ezio Melotti
975077a889
Refactor a few tests to use the new requires_zlib decorator.
2011-05-19 22:03:22 +03:00
Ezio Melotti
b3aedd4862
#9424 : Replace deprecated assert* methods in the Python test suite.
2010-11-20 19:04:17 +00:00
Éric Araujo
1c5054996f
Fix one omission in r78359
2010-11-06 02:12:51 +00:00
Antoine Pitrou
ea5d827b72
Merged revisions 85503 via svnmerge from
...
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r85503 | antoine.pitrou | 2010-10-15 00:11:44 +0200 (ven., 15 oct. 2010) | 2 lines
More proper closing of files
........
2010-10-14 22:14:36 +00:00
Antoine Pitrou
92f60ed82a
More proper closing of files
2010-10-14 22:11:44 +00:00
Brian Curtin
d40e6f70a5
Implement #1578269 . Patch by Jason R. Coombs.
...
Added Windows support for os.symlink when run on Windows 6.0 or greater,
aka Vista. Previous Windows versions will raise NotImplementedError
when trying to symlink.
Includes numerous test updates and additions to test_os, including
a symlink_support module because of the fact that privilege escalation
is required in order to run the tests to ensure that the user is able
to create symlinks. By default, accounts do not have the required
privilege, so the escalation code will have to be exposed later (or
documented on how to do so). I'll be following up with that work next.
Note that the tests use ctypes, which was agreed on during the PyCon
language summit.
2010-07-08 21:39:08 +00:00
Tarek Ziadé
9623980d01
Merged revisions 80833 via svnmerge from
...
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r80833 | tarek.ziade | 2010-05-06 00:27:31 +0200 (Thu, 06 May 2010) | 9 lines
Merged revisions 80830 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r80830 | tarek.ziade | 2010-05-06 00:15:31 +0200 (Thu, 06 May 2010) | 1 line
Fixed #4265 : shutil.copyfile() was leaking file descriptors when disk fills
........
................
2010-05-05 22:39:31 +00:00