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

About "os.R_OK" in general.py #8909

Merged
merged 1 commit into from
Aug 9, 2022
Merged

Conversation

19190205wzy
Copy link
Contributor

@19190205wzy 19190205wzy commented Aug 9, 2022

The notes says "Return True if directory has write permissions", however, the code below is "os.R_OK", I think "os.W_OK" is preferred.

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

  • Enhanced file write permission check in utility functions.

📊 Key Changes

  • Corrected the is_writeable function to check for write permissions (os.W_OK) instead of read permissions (os.R_OK).

🎯 Purpose & Impact

  • 🎯 Purpose: To ensure the is_writeable function accurately verifies if a directory is writeable, which is crucial for operations involving file creation or modification.
  • 💥 Impact: This fix prevents potential bugs where the system incorrectly assumes it cannot write to a directory due to a permissions check error, improving overall reliability. Users can expect more consistent behavior when the application interacts with the filesystem, especially on platforms like Windows where permission issues are more common.

…ver, the code below is "os.R_OK", I think "os.W_OK" is preferred.
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

👋 Hello @19190205wzy, thank you for submitting a YOLOv5 🚀 PR! To allow your work to be integrated as seamlessly as possible, we advise you to:

  • ✅ Verify your PR is up-to-date with upstream/master. If your PR is behind upstream/master an automatic GitHub Actions merge may be attempted by writing /rebase in a new comment, or by running the following code, replacing 'feature' with the name of your local branch:
git remote add upstream https://github.com/ultralytics/yolov5.git
git fetch upstream
# git checkout feature  # <--- replace 'feature' with local branch name
git merge upstream/master
git push -u origin -f
  • ✅ Verify all Continuous Integration (CI) checks are passing.
  • ✅ Reduce changes to the absolute minimum required for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." -Bruce Lee

@glenn-jocher glenn-jocher merged commit b551098 into ultralytics:master Aug 9, 2022
@glenn-jocher
Copy link
Member

@19190205wzy yes, you are right. This is a good fix!

PR is merged. Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐

ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
The notes says "Return True if directory has write permissions", however, the code below is "os.R_OK", I think "os.W_OK" is preferred.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants