Browse Source

Ensure that FD 3 gets closed

It appears that Python doesn't reliably (or maybe just doesn't at all) flush and close non-standard FDs on exit. This randomly caused the artefacts list to get lost to /dev/null.
tags/v1.1
JustAnotherArchivist 1 year ago
parent
commit
9474c44171
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      codearchiver/cli.py

+ 3
- 2
codearchiver/cli.py View File

@@ -206,8 +206,9 @@ def main():
if args.writeArtefactsFd3:
with storage.lock():
artefacts = storage.list_new_files()
for filename in artefacts:
print(filename, file = artefactsFd)
with artefactsFd:
for filename in artefacts:
print(filename, file = artefactsFd)

if __name__ == '__main__':
main()

Loading…
Cancel
Save