Просмотр исходного кода

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 год назад
Родитель
Сommit
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()

Загрузка…
Отмена
Сохранить