You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test.py: The following code can be run after commenting sleep, otherwise the file will always be empty
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2021-03-05.22:56:17.631>created_at=<Date2021-03-02.10:43:49.915>labels= ['build', 'invalid', '3.10', 'expert-IO']
title='Operation conflict between time package and file'updated_at=<Date2021-03-05.22:56:17.629>user='https://github.com/Minaki'
I unlinked the preliminary versions of the code minimized in the 3 post.
The posted code is buggy: it opens a file and then start an infinite loop. It has to be interrupted someway, and the file may not be properly closed and flushed to disk. When I make the loop finite and explicitly close the file, or even better, use a 'with' statement, the file is written as expected. At least on Windows, it runs noticeably slower with the sleep because the minimum sleep is 1/16 second.
Minaki, if you find a problem with unbuggy code, you can post and reopen. If you are a beginner who does not know about things like closing file, flushing to disk, and the with statement, you should post to a question and answer forum such as python-list and ask 'Is Python or my code buggy?'
terryjreedy
changed the title
Operation conflict between time package and file in python 3.8 3.9
Operation conflict between time package and file
Mar 5, 2021
terryjreedy
changed the title
Operation conflict between time package and file in python 3.8 3.9
Operation conflict between time package and file
Mar 5, 2021
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: