os.writev() behaviour unpredictable when hitting file system full (28)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 36k
- PR merge metrics
- PR metrics pending
Description
Bug report
os.writev() has an unpredictable behaviour when writing on a file system that becomes full:
For example:
try:
fd=os.open(file, os.O_WRONLY|os.O_CREAT|os.O_APPEND)
result = os.writev(fd,iovtable[0:MAXIOV])
except OSError as e:
...
# at this point result might return some bytes written (not necessarly corresponding to iov lengths, or even not be defined at all.
Your environment
centos 7.
Python 3.9 (but probably the same on 3.11)
This can easily be worked around by specifying in the documentation that os.writev() returns the actual number of bytes written in case of success, but the contents of the return value are unpredicatbale in case of errors.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the os.writev() documentation and review how its return value and OSError behavior are currently described. Compare that wording with the reported full-filesystem case; done means the documentation clearly states what callers can rely on after success and after an error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100