Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-118507 : Refactor nt._path_is* #118755

Merged
merged 44 commits into from
May 21, 2024
Merged

Conversation

nineteendo
Copy link
Contributor

@nineteendo nineteendo commented May 8, 2024

@nineteendo

This comment was marked as resolved.

@nineteendo

This comment was marked as resolved.

@eryksun

This comment was marked as resolved.

Modules/posixmodule.c Outdated Show resolved Hide resolved
Modules/posixmodule.c Outdated Show resolved Hide resolved
Modules/posixmodule.c Outdated Show resolved Hide resolved
Lib/test/test_ntpath.py Outdated Show resolved Hide resolved
nineteendo and others added 2 commits May 9, 2024 12:41
Co-authored-by: Eryk Sun <eryksun@gmail.com>
@nineteendo
Copy link
Contributor Author

@zooba, I added the test Eryk requested.

@nineteendo

This comment was marked as spam.

@erlend-aasland
Copy link
Contributor

erlend-aasland commented May 21, 2024

You already have two extremely competent reviewers for this PR: Eryk and Steve. Why are you keeping pinging other core devs? This only creates unneeded noise; please stop it.

@nineteendo
Copy link
Contributor Author

nineteendo commented May 21, 2024

OK, but I'm not sure what Steve is waiting for. I thought we were done here. Could you react with eyes if you saw this?
I don't want to wait till June 8th before pinging the issue and another week before I can ask on Discourse.

@zooba
Copy link
Member

zooba commented May 21, 2024

Mostly I was waiting for enough free time to give it a proper review - while I get work time to work on Python, it's not strictly my job, so I can't always prioritise reviews over other things.

This looks good now. Since we need an additional change for 3.12, we'll need a manual backport for that

@zooba zooba merged commit b641825 into python:main May 21, 2024
43 checks passed
@miss-islington-app
Copy link

Thanks @nineteendo for the PR, and @zooba for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 21, 2024
…r other cases (pythonGH-118755)

(cherry picked from commit b641825)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
@miss-islington-app
Copy link

Sorry, @nineteendo and @zooba, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker b64182550f73e556344bd754d32e3be5d22a74e1 3.12

@bedevere-app
Copy link

bedevere-app bot commented May 21, 2024

GH-119360 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label May 21, 2024
zooba pushed a commit that referenced this pull request May 22, 2024
…r cases (GH-118755)

(cherry picked from commit b641825)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
@nineteendo nineteendo deleted the refactor-nt._path_is branch May 22, 2024 04:59
nineteendo added a commit to nineteendo/cpython that referenced this pull request May 22, 2024
@bedevere-app
Copy link

bedevere-app bot commented May 22, 2024

GH-119381 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label May 22, 2024
@bedevere-app
Copy link

bedevere-app bot commented May 22, 2024

GH-119381 is a backport of this pull request to the 3.12 branch.

@nineteendo
Copy link
Contributor Author

Note that it's not a full backport, as the C implementation of ntpath.isjunction() & ntpath.lexists() isn't included yet to minimise the risk of changed behaviour. We can consider backporting them later once we're more confident.

@bedevere-app
Copy link

bedevere-app bot commented May 22, 2024

GH-119420 is a backport of this pull request to the 3.12 branch.

1 similar comment
@bedevere-app
Copy link

bedevere-app bot commented May 27, 2024

GH-119420 is a backport of this pull request to the 3.12 branch.

@socal-nerdtastic
Copy link
Contributor

Do you guys realize this breaks using path as a kwarg? You may want to update the docs.

os.path.exists(path=".")

TypeError: nt._path_exists() takes no keyword arguments

@nineteendo
Copy link
Contributor Author

@zooba, should this be fixed?

diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index f02b6d1779827f..2a65752d9431fe 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -5385,7 +5385,6 @@ _testFileType(path_t *path, int testedType)
 os._path_exists -> bool
 
     path: path_t(allow_fd=True, suppress_value_error=True)
-    /
 
 Test whether a path exists.  Returns False for broken symbolic links.
 
@@ -5403,7 +5402,6 @@ os__path_exists_impl(PyObject *module, path_t *path)
 os._path_lexists -> bool
 
     path: path_t(allow_fd=True, suppress_value_error=True)
-    /
 
 Test whether a path exists.  Returns True for broken symbolic links.

@nineteendo
Copy link
Contributor Author

@sobolevn is this a problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 bugs and security fixes 3.13 bugs and security fixes 3.14 new features, bugs and security fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants