Commit Graph

100 Commits

Author SHA1 Message Date
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 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 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 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 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 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