-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-93253: Add an explicit message for when there is not enough disk space to create new semaphores #93254
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
Conversation
When there is not enough disk space to create new semaphores, a confusing error occurs. This fix adds a clearer message.
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
@@ -59,6 +60,10 @@ def __init__(self, kind, value, maxvalue, *, ctx): | |||
unlink_now) | |||
except FileExistsError: | |||
pass | |||
except OSError as e: | |||
if e.errno == errno.ENOSPC: | |||
raise Exception("There is not enough space in the" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a more specific error, perhaps ProcessError
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Adam here.
except OSError as e: | ||
if e.errno == errno.ENOSPC: | ||
raise Exception("There is not enough space in the" | ||
" file system(tmpfs) to create a semaphore") from e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does "tmpfs" refer to here? Is it posix specific?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Adam here, since this path runs on Windows as well, mentioning tmpfs is misleading.
Misc/NEWS.d/next/Core and Builtins/2022-05-26-11-44-51.gh-issue-93253.egSDbi.rst
Outdated
Show resolved
Hide resolved
Ideally you should also add a test for the new error message, although I'm not sure how you'd set up the necessary conditions off the top of my head. A |
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@@ -59,6 +60,10 @@ def __init__(self, kind, value, maxvalue, *, ctx): | |||
unlink_now) | |||
except FileExistsError: | |||
pass | |||
except OSError as e: | |||
if e.errno == errno.ENOSPC: | |||
raise Exception("There is not enough space in the" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Adam here.
except OSError as e: | ||
if e.errno == errno.ENOSPC: | ||
raise Exception("There is not enough space in the" | ||
" file system(tmpfs) to create a semaphore") from e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Adam here, since this path runs on Windows as well, mentioning tmpfs is misleading.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
When there is not enough disk space to create new semaphores, a confusing error occurs.
This fix adds a clearer message.