Message58918
Index: Lib/shutil.py
===================================================================
--- Lib/shutil.py (revision 59581)
+++ Lib/shutil.py (working copy)
@@ -156,6 +156,16 @@
elif onerror is None:
def onerror(*args):
raise
+
+ try:
+ if os.path.islink(path):
+ if ignore_errors:
+ return
+ else:
+ raise IOError('path can not be symbolic link')
+ except IOError, err:
+ onerror(os.path.islink, path, sys.exc_info())
+
names = []
try:
names = os.listdir(path)
-------------------
How does this look? The error handling is slightly different for this
case because it can not continue if 'ignore_errors' is True. I will
update the doc if the code change is ok.
On Dec 20, 2007 12:43 PM, Guido van Rossum <[email protected]> wrote:
>
> Guido van Rossum added the comment:
>
> Thanks for the patch. I think it should raise IOError, not ValueError,
> and it should use the onerror() handling used for all other errors.
> Also, can you include an update for the docs in the Doc tree?
>
>
> __________________________________
> Tracker <[email protected]>
> <http://bugs.python.org/issue1669>
> __________________________________
> |
|
| Date |
User |
Action |
Args |
| 2007-12-20 19:45:45 | draghuram | set | spambayes_score: 0.000963189 -> 0.00096318906 recipients:
+ draghuram, gvanrossum, ntkoopman |
| 2007-12-20 19:45:45 | draghuram | link | issue1669 messages |
| 2007-12-20 19:45:44 | draghuram | create | |
|