Message409303
"""
Using a dictionary for open files.
The file is filled with NULL. Only the last entry is normal.
Result:
00 00 00 00 ... 00 0A 48 65 6C 6C 6F 0A
Ubuntu - 3.8.10
Windows - 3.9.8
"""
fhandles = {}
for f in range(100):
fh = fhandles.setdefault("suffix", open(r"test.txt", "w"))
fh.write("\nHello\n")
fh.flush()
for f in fhandles.values():
f.close()
import sys
print(sys.version_info) |
|
Date |
User |
Action |
Args |
2021-12-29 12:34:59 | Keepun | set | recipients:
+ Keepun |
2021-12-29 12:34:59 | Keepun | set | messageid: <1640781299.57.0.336049681987.issue46193@roundup.psfhosted.org> |
2021-12-29 12:34:59 | Keepun | link | issue46193 messages |
2021-12-29 12:34:59 | Keepun | create | |
|