This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年07月26日 21:03 by maliubiao@gmail.com, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (3) | |||
|---|---|---|---|
| msg166519 - (view) | Author: coder.maliubiao (maliubiao@gmail.com) | Date: 2012年07月26日 21:03 | |
the code:
import os,stat
mode=os.stat("a broken link file").st_mode
then i got :OSError: [Errno 2] No such file or directory.
why not just treat a broken link as something existing and don't report any error.
|
|||
| msg166533 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2012年07月27日 02:23 | |
Because we are doing what the linux stat call (and command) does . See man stat. |
|||
| msg166543 - (view) | Author: Hynek Schlawack (hynek) * (Python committer) | Date: 2012年07月27日 06:17 | |
For the sake of completeness: what you're looking for is os.lstat. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:33 | admin | set | github: 59666 |
| 2012年07月27日 06:17:19 | hynek | set | nosy:
+ hynek messages: + msg166543 |
| 2012年07月27日 02:23:28 | r.david.murray | set | status: open -> closed nosy: + r.david.murray messages: + msg166533 resolution: not a bug stage: resolved |
| 2012年07月26日 21:03:20 | maliubiao@gmail.com | create | |