瀏覽代碼

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 年之前
父節點
當前提交
9474c44171
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. +3
    -2
      codearchiver/cli.py

+ 3
- 2
codearchiver/cli.py 查看文件

@@ -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…
取消
儲存