--> -->

ValueError

I/O operation on closed file

If you want to report a bug, please save this page and attach it to your bug report.

Traceback

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

  1. /usr/lib/python2.4/site-packages/MoinMoin/request/__init__.py in run (self=<MoinMoin.request.request_modpython.Request object>)

    1. 1304 self.page.send_page()
    2. 1305 else:
    3. 1306 handler(self.page.page_name, self)
    4. 1307
    5. 1308 # every action that didn't use to raise MoinMoinFinish must call this now:
    • handler = <function execute>
    • self = <MoinMoin.request.request_modpython.Request object>
    • self.page = <MoinMoin.Page.Page object>
    • self.page.page_name = u'TravelInsurance'
  2. /usr/lib/python2.4/site-packages/MoinMoin/action/AttachFile.py in execute (pagename=u'TravelInsurance', request=<MoinMoin.request.request_modpython.Request object>)

    1. 511 handler = globals().get('_do_%s' % do[0])
    2. 512 if handler:
    3. 513 msg = handler(pagename, request)
    4. 514 else:
    5. 515 msg = _('Unsupported AttachFile sub-action: %s') % (wikiutil.escape(do[0]), )
    • msg undefined
    • handler = <function _do_upload>
    • pagename = u'TravelInsurance'
    • request = <MoinMoin.request.request_modpython.Request object>
  3. /usr/lib/python2.4/site-packages/MoinMoin/action/AttachFile.py in _do_upload (pagename=u'TravelInsurance', request=<MoinMoin.request.request_modpython.Request object>)

    1. 590 # add the attachment
    2. 591 try:
    3. 592 target, bytes = add_attachment(request, pagename, target, filecontent, overwrite=overwrite)
    4. 593 msg = _("Attachment '%(target)s' (remote name '%(filename)s')"
    5. 594 " with %(bytes)d bytes saved.") % {
    • target = u'travel-insurance-schedule.pdf'
    • bytes undefined
    • global add_attachment = <function add_attachment>
    • request = <MoinMoin.request.request_modpython.Request object>
    • pagename = u'TravelInsurance'
    • filecontent = <closed file '<fdopen>', mode 'w+b'>
    • overwrite = 1
  4. /usr/lib/python2.4/site-packages/MoinMoin/action/AttachFile.py in add_attachment (request=<MoinMoin.request.request_modpython.Request object>, pagename=u'TravelInsurance', target=u'travel-insurance-schedule.pdf', filecontent=<closed file '<fdopen>', mode 'w+b'>, overwrite=1)

    1. 208 stream = open(fpath, 'wb')
    2. 209 try:
    3. 210 _write_stream(filecontent, stream)
    4. 211 finally:
    5. 212 stream.close()
    • global _write_stream = <function _write_stream>
    • filecontent = <closed file '<fdopen>', mode 'w+b'>
    • stream = <closed file '/srv/www/mywiki/data/pages/TravelI...hments/travel-insurance-schedule.pdf', mode 'wb'>
  5. /usr/lib/python2.4/site-packages/MoinMoin/action/AttachFile.py in _write_stream (content=<closed file '<fdopen>', mode 'w+b'>, stream=<closed file '/srv/www/mywiki/data/pages/TravelI...hments/travel-insurance-schedule.pdf', mode 'wb'>, bufsize=8192)

    1. 175 if hasattr(content, 'read'): # looks file-like
    2. 176 import shutil
    3. 177 shutil.copyfileobj(content, stream, bufsize)
    4. 178 elif isinstance(content, str):
    5. 179 stream.write(content)
    • shutil = <module 'shutil' from '/usr/lib/python2.4/shutil.pyc'>
    • shutil.copyfileobj = <function copyfileobj>
    • content = <closed file '<fdopen>', mode 'w+b'>
    • stream = <closed file '/srv/www/mywiki/data/pages/TravelI...hments/travel-insurance-schedule.pdf', mode 'wb'>
    • bufsize = 8192
  6. /usr/lib/python2.4/shutil.py in copyfileobj (fsrc=<closed file '<fdopen>', mode 'w+b'>, fdst=<closed file '/srv/www/mywiki/data/pages/TravelI...hments/travel-insurance-schedule.pdf', mode 'wb'>, length=8192)

    1. 20 """copy data from file-like object fsrc to file-like object fdst"""
    2. 21 while 1:
    3. 22 buf = fsrc.read(length)
    4. 23 if not buf:
    5. 24 break
    • buf undefined
    • fsrc = <closed file '<fdopen>', mode 'w+b'>
    • fsrc.read = <built-in method read of file object>
    • length = 8192

ValueError

I/O operation on closed file

  • args = ('I/O operation on closed file',)

System Details