GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — bpo-46398: posixshmem module shm_rename freebsd support. by devnexen · Pull Request #30621 · python/cpython Conversation
|
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| Rename a shared memory object. | ||
|
|
||
| Remove a shared memory object and relink to another path |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| Remove a shared memory object and relink to another path | |
| Remove a shared memory object and relink to another path. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| _posixshmem.shm_rename | ||
| path_from: unicode | ||
| path_to: unicode | ||
| flags: int |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| flags: int | |
| flags: int | |
| / |
I think it was mistake to make parameters keyword-or-positional in other functions. It is better to make them positional-only, it will help if we decide to rename parameters.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| With the SHM_RENAME_NOREPLACE flag, an error will be returned | ||
| if the new name exists. | ||
| """ | ||
| if platform.system() != "FreeBSD": |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It is better to use hasattr(). If in future shm_rename() be added on other platforms, it will automatically add support of SharedMemory.rename().
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| const char *from = PyUnicode_AsUTF8(path_from); | ||
| const char *to = PyUnicode_AsUTF8(path_to); | ||
| if (from == NULL || to == NULL) { | ||
| return NULL; | ||
| } |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This function has the same bug as shm_open() and shm_unlink() (see #115886). Please check the names for embedded null characters.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if newname: | ||
| newname = "/" + newname if self._prepend_leading_slash else newname | ||
| r = _posixshmem.shm_rename(self._name, newname, flags) | ||
| if r == None: |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It is always true, isn't?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if platform.system() != "FreeBSD": | ||
| raise OSError("Unsupported operation on this platform") | ||
|
|
||
| if newname: |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
So it simply returns False if newname is empty and returns True otherwise? Why add such check in this method?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| With the SHM_RENAME_NOREPLACE flag, an error will be returned | ||
| if the new name exists. | ||
| """ | ||
| if !platform.hasattr("shm_rename"): |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| if !platform.hasattr("shm_rename"): | |
| if not platform.hasattr("shm_rename"): |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
What is this platform.hasattr() function? Where does it come from?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The PR is idle for 2 years, the author didn't reply to reviews. I close the PR. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.