[Checkins] [zopefoundation/Zope] 5d9a29: Prevent `ValueError: I/O operation on closed file.`

Michael Howitz noreply at github.com
Tue Mar 12 16:56:39 CET 2019


  Branch: refs/heads/fix-FileUpload
  Home:   https://github.com/zopefoundation/Zope
  Commit: 5d9a292403aed40380c27d8705c9e1d5bbcef646
      https://github.com/zopefoundation/Zope/commit/5d9a292403aed40380c27d8705c9e1d5bbcef646
  Author: Michael Howitz <mh at gocept.com>
  Date:   2019-03-12 (Tue, 12 Mar 2019)

  Changed paths:
    M CHANGES.rst
    M src/ZPublisher/HTTPRequest.py

  Log Message:
  -----------
  Prevent `ValueError: I/O operation on closed file.`

when using `ZPublisher.HTTPRequest.FileUpload` in Python 3.

This happened before because Python 3 seems to garbage collect objects earlier
than Python 2 and FieldStorage was no longer referenced after storing its file
on the `FileUpload` instance. But `FieldStorage` closed its file in its
`__del__` method.




More information about the checkins mailing list