KEMBAR78
GH-118289: Fix handling of non-directories in `os.path.realpath()` by barneygale · Pull Request #118290 · python/cpython · GitHub
Skip to content

Conversation

@barneygale
Copy link
Contributor

@barneygale barneygale commented Apr 25, 2024

In strict mode, raise NotADirectoryError if we encounter a non-directory while we still have path parts left to process.

We use a part_count variable rather than len(rest) because the rest stack also contains markers for unresolved symlinks.

In strict mode, raise `NotADirectoryError` if a file path is given with a
trailing slash, or subsequent dot segments.

We use a `part_count` variable rather than `len(rest)` because the `rest`
stack also contains markers for unresolved symlinks.
@barneygale barneygale marked this pull request as ready for review April 25, 2024 18:08
Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general I support this idea. It may even be considered as a bugfix.

@barneygale barneygale added the needs backport to 3.13 bugs and security fixes label May 29, 2024
`NotADirectoryError` was already raised.

This reverts commit 3390dbc.
Co-authored-by: Eryk Sun <eryksun@gmail.com>
barneygale and others added 7 commits May 31, 2024 22:57
* Add docs for new APIs
* Add soft-deprecation notices
* Add What's New porting entries
* Update comments referencing `PyFrame_LocalsToFast()` to mention the proxy instead
* Other related cleanups found when looking for refs to the deprecated APIs
* Clarify impact on default behaviour of exec, eval, etc
* Update documentation for changes to PyEval_GetLocals (pythongh-74929)

Closes pythongh-11888
Only call `gc_restore_tid()` from stop-the-world contexts.
`worklist_pop()` can be called while other threads are running, so use a
relaxed atomic to modify `ob_tid`.
@nineteendo
Copy link
Contributor

Did git merge main not work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.