Message58918
| Author |
draghuram |
| Recipients |
draghuram, gvanrossum, ntkoopman |
| Date |
2007年12月20日.19:45:44 |
| SpamBayes Score |
0.00096318906 |
| Marked as misclassified |
No |
| Message-id |
<2c51ecee0712201145j3472f02aq282631d6963feaad@mail.gmail.com> |
| In-reply-to |
<ca471dc20712200943u6ff60674gd4bfa00e30ae4f17@mail.gmail.com> |
| Content |
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 <report@bugs.python.org> 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 <report@bugs.python.org>
> <http://bugs.python.org/issue1669>
> __________________________________
> |
|
History
|
|---|
| 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 |
|