Comments (6)
As already explained, there's no bug in the docs or implementation here. However, we might be able to clarify the docs a bit: I think the confusion here came from the fact that the broken symlink case is called out explicitly in a separate sentence:
cpython/Doc/library/os.path.rst
Lines 148 to 149 in 01bd74e
This reads a bit clearer to me:
Return
True
if path refers to an existing path, including broken symbolic links.
from cpython.
os.path.lexists()
doesn't follow symlinks, so it returns True
for a broken symlink. Use os.path.exists()
if you need False
for a broken symlink.
from cpython.
But what is the purpose of a function that only returns True?
from cpython.
os.path.lexists()
returns True
only if path
exists, regardless of the file type. It's useful when one needs to know whether anything with the given name exists, regardless of whether it's a regular file, directory, symlink, named pipe/socket, or device.
from cpython.
If the doc matches the behavior, there is no bug. If the behavior is intended, and useful, we are unlikely to change it. Feature changes usually need be be discussed on discuss/ideas.
from cpython.
Resolved by:
from cpython.
Related Issues (20)
- Window does not resize correctly on KDE HOT 2
- Support loading keys and certificates as variables (bytes) in particular in the load_cert_chain function
- `test_free_threading.test_racing_iter_extend` crash HOT 4
- How to dynamically create PEP695 classes? Let's add a test for it
- inspect.signature.BoundArguments "POSITIONAL_OR_KEYWORD" Arguments are always args HOT 6
- #L1-L783 HOT 2
- #118577
- Add thread-safety clarifications to the SSLContext documentation
- Improve TypeError error message when trying to iterate over an object of type 'int' HOT 3
- ``test_bdb`` leaks references HOT 3
- Initialize/Finalize Python multiple time and import datetime each time lead to a memory corruption HOT 8
- ``Objects/frameobject.c`` lacks error-checking HOT 3
- Centralize power caching in `_pylong.py`
- Missing error handling in `_PyEval_GetFrameLocals` in `ceval.c`
- Use a less red-ish color for the new prompt and non-error colorized traceback text HOT 3
- Remove new pyrepl "warning" on Windows HOT 4
- add warning for eval and exec (unsafe usage may lead to critical vulnerabilities)
- Noted an issue while using input() HOT 2
- is it necessary the urllib.parse._splitnetloc support # and ? in username or password within the netloc? HOT 1
- asyncio.StreamReader flush/read buffer HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpython.