Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-118263: Generalize path_t for C level optimizations #118355

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

Merged
merged 31 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ae2e171
Add `null_embeddable`
nineteendo Apr 27, 2024
0625bf1
Add `make_wide`
nineteendo Apr 28, 2024
28b4b6e
📜🤖 Added by blurb_it.
blurb-it[bot] Apr 28, 2024
19209c6
Fix typo & add type casts
nineteendo Apr 28, 2024
7ca6036
Add test for fast paths
nineteendo Apr 28, 2024
55c1883
Build tuple faster
nineteendo Apr 29, 2024
a9b7bdd
Merge branch 'main' into generalize-path_t
nineteendo Apr 29, 2024
42b2ca1
Merge branch 'main' into generalize-path_t
nineteendo Apr 30, 2024
5b44245
Resolve merge conflicts
nineteendo Apr 30, 2024
1c93617
Support `make_wide=False` on Windows
nineteendo May 3, 2024
dc36f2e
Update generated code
nineteendo May 3, 2024
0a9d497
Add `suppress`
nineteendo May 4, 2024
14d711e
Fix `allow_fd`
nineteendo May 4, 2024
89e83fa
Allow paths of any length
nineteendo May 4, 2024
d6a174e
Update generated files
nineteendo May 4, 2024
4e8b713
Simplify bytes conversion
nineteendo May 4, 2024
0777a31
Remove leftovers
nineteendo May 4, 2024
46059d1
Update conditions to use `PyBytes_Check()`
nineteendo May 4, 2024
f95da67
Fix access violation attempt 1
nineteendo May 4, 2024
e8ab7d7
Fix segmentation fault
nineteendo May 4, 2024
3b21f5d
Fix segmentation fault attempt 2
nineteendo May 4, 2024
7b3a785
Fix access violation attempt 1
nineteendo May 4, 2024
a94c852
Clear ValueError
nineteendo May 4, 2024
5f717c9
Apply suggestions from code review
nineteendo May 4, 2024
b76774b
Same docstring for python fallback
nineteendo May 4, 2024
f2537a1
Revert newline
nineteendo May 4, 2024
aa0df5c
Merge branch 'main' into generalize-path_t
nineteendo May 22, 2024
8f67225
Merge branch 'main' into generalize-path_t
nineteendo May 22, 2024
360326d
Fix pointers
nineteendo May 22, 2024
3514bdb
Return false in case of value error
nineteendo May 22, 2024
e362054
Add null check
nineteendo May 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix allow_fd
  • Loading branch information
nineteendo committed May 4, 2024
commit 14d711e7bf386d3cfa1d8e2d7d529ae7a9830634
10 changes: 5 additions & 5 deletions 10 Modules/clinic/posixmodule.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions 16 Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -5123,15 +5123,15 @@ os__path_splitroot_impl(PyObject *module, path_t *path)
/*[clinic input]
os._path_isdir

s as path: path_t(suppress=True)
s as path: path_t(allow_fd=True, suppress=True)

Return true if the pathname refers to an existing directory.

[clinic start generated code]*/

static PyObject *
os__path_isdir_impl(PyObject *module, path_t *path)
/*[clinic end generated code: output=0adeafd60704f710 input=945359aa5bde6f2e]*/
/*[clinic end generated code: output=0adeafd60704f710 input=3f8bf1ea0cc77e0c]*/
{
HANDLE hfile;
BOOL close_file = TRUE;
Expand Down Expand Up @@ -5217,15 +5217,15 @@ os__path_isdir_impl(PyObject *module, path_t *path)
/*[clinic input]
os._path_isfile

path: path_t(suppress=True)
path: path_t(allow_fd=True, suppress=True)

Test whether a path is a regular file

[clinic start generated code]*/

static PyObject *
os__path_isfile_impl(PyObject *module, path_t *path)
/*[clinic end generated code: output=4f72e7b1ada002da input=f095340c0e8e84e9]*/
/*[clinic end generated code: output=4f72e7b1ada002da input=b6c69c96e1722a27]*/
{
HANDLE hfile;
BOOL close_file = TRUE;
Expand Down Expand Up @@ -5311,15 +5311,15 @@ os__path_isfile_impl(PyObject *module, path_t *path)
/*[clinic input]
os._path_exists

path: path_t(suppress=True)
path: path_t(allow_fd=True, suppress=True)

Test whether a path exists. Returns False for broken symbolic links

[clinic start generated code]*/

static PyObject *
os__path_exists_impl(PyObject *module, path_t *path)
/*[clinic end generated code: output=69e6089df1fe463a input=ba8bbd209962ca90]*/
/*[clinic end generated code: output=69e6089df1fe463a input=3a73be0affbbe43c]*/
{
HANDLE hfile;
BOOL close_file = TRUE;
Expand Down Expand Up @@ -5394,15 +5394,15 @@ os__path_exists_impl(PyObject *module, path_t *path)
/*[clinic input]
os._path_islink

path: path_t(suppress=True)
path: path_t(allow_fd=True, suppress=True)

Test whether a path is a symbolic link

[clinic start generated code]*/

static PyObject *
os__path_islink_impl(PyObject *module, path_t *path)
/*[clinic end generated code: output=109ad77ec747b3b7 input=a59fe6ee2804173f]*/
/*[clinic end generated code: output=109ad77ec747b3b7 input=3937a93631697d6c]*/
{
HANDLE hfile;
BOOL close_file = TRUE;
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.