# Suggestion for pathlib: differentiate explicit and implicit local paths (pathlib.StrictPath?)

**URL:** <https://discuss.python.org/t/suggestion-for-pathlib-differentiate-explicit-and-implicit-local-paths-pathlib-strictpath/31235>\
**Category:** Ideas\
**Created:** [August 8, 2023, 9:08am UTC](https://discuss.python.org/t/suggestion-for-pathlib-differentiate-explicit-and-implicit-local-paths-pathlib-strictpath/31235 "2023-08-08T09:08:23Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![eryksun](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/eryksun/32/697_2.png) [@eryksun](https://discuss.python.org/u/eryksun)\
**Post date:** [August 8, 2023, 12:12pm UTC](https://discuss.python.org/t/suggestion-for-pathlib-differentiate-explicit-and-implicit-local-paths-pathlib-strictpath/31235/11 "2023-08-08T12:12:12Z")

</div>

The `file` argument of `execlp()` or `execvp()` must be a file. It isn’t a shell command such as `cd`. If the name contains a slash, then it gets resolved relative to the current working directory. If it has no slash, then it gets resolved against the directories in `PATH`, sequentially until an accessible file is found.

The decision to always normalize away a leading “.” component in `os.path.normpath()` and `pathlib.Path` can cause problems, unnecessarily. On POSIX, a leading “.” component can be safely omitted if the path has more than one component. On Windows, a leading “.” component should never be omitted automatically.

Another case on Windows is the need to access a named stream in a single-letter filename in the current directory, such as a file named “c” that contains a stream named “spam”. Opening “c:spam” will be resolved against the working directory on drive “C:”. One has to use “./c:spam” in order to avoid the ambiguity. This case has already been fixed for `pathlib.Path` in Python 3.12, but it’s still broken by design for `os.path.normpath()`.

---

_[View the full topic](https://discuss.python.org/t/suggestion-for-pathlib-differentiate-explicit-and-implicit-local-paths-pathlib-strictpath/31235)._
