11.06.14 05:28, Antoine Pitrou написав(ла):
close() should indeed be idempotent on all bundled IO class
implementations (otherwise it's a bug), and so should it preferably on
third-party IO class implementations.

There are some questions about close().

1. If object owns several resources, should close() try to clean up all them if error is happened during cleaning up some resource. E.g. should BufferedRWPair.close() close reader if closing writer failed?

2. If close() raises an exception, should repeated call of close() raise an exception or do nothing? E.g. if GzipFile.close() fails during writing gzip tail (CRC and size), should repeated call of it try to write this tail again?

3. If close() raises an exception, should the closed attribute (if exists) be True or False?

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to