Description
In 1.7 alpha release (see traceback below for details), uploading an attachment gives error. The upload actually works, but the error would suggest it didn't work.
Steps to reproduce
- Select Attachment link from a page
- Browse to desired file (e.g., .jpg) and select it
- Select Upload
- See error (see Traceback below)
- Return to Attachment page
- Refresh view
- Notice file has been uploaded successfully
Example
Component selection
- general
Details
MoinMoin Version |
|
OS and Version |
|
Python Version |
|
Server Setup |
|
Server Details |
|
Language you are using the wiki in (set in the browser/UserPreferences) |
|
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.
/home/moin/moin-1.7-docbook/MoinMoin/request/__init__.py in run (self=<MoinMoin.request.request_fcgi.Request object>)
- 1273 self.page.send_page()
- 1274 else:
- 1275 handler(self.page.page_name, self)
- 1276
1277 # every action that didn't use to raise MoinMoinFinish must call this now:
handler = <function execute>
self = <MoinMoin.request.request_fcgi.Request object>
self.page = <MoinMoin.Page.Page object>
self.page.page_name = u'DataImportTool'
/home/moin/moin-1.7-docbook/MoinMoin/action/AttachFile.py in execute (pagename=u'DataImportTool', request=<MoinMoin.request.request_fcgi.Request object>)
- 512 handler = globals().get('_do_%s' % do[0])
- 513 if handler:
- 514 msg = handler(pagename, request)
- 515 else:
516 msg = _('Unsupported AttachFile sub-action: %s') % (wikiutil.escape(do[0]), )
msg undefined
handler = <function _do_upload>
pagename = u'DataImportTool'
request = <MoinMoin.request.request_fcgi.Request object>
/home/moin/moin-1.7-docbook/MoinMoin/action/AttachFile.py in _do_upload (pagename=u'DataImportTool', request=<MoinMoin.request.request_fcgi.Request object>)
- 589 # add the attachment
- 590 try:
- 591 add_attachment(request, pagename, target, filecontent, overwrite=overwrite)
- 592
- 593 bytes = len(filecontent)
global add_attachment = <function add_attachment>
request = <MoinMoin.request.request_fcgi.Request object>
pagename = u'DataImportTool'
target = u'csvimp1.JPG'
filecontent = "\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x01\x00\x00\x00\x00\xff\xdb\x00C\x00\x08\x06\x06\x07\x06\x05\x08\x07\x07\x07\t\t\x08\n\x0c\x14\r\x0c\x0b\x0b\x0c\x19\x12...\x00\x9f\xa8\xff\x00\xef\xaa?\xe1'\xb0\xff\x00\x9f\xa8\xff\x00\xef\xaa9@\xe8h\xae{\xfe\x12{\x0f\xf9\xfa\x8f\xfe\xfa\xa3\xfe\x12{\x0f\xf9\xfa\x8f\xfe\xfa\xa2\xcc\x0f\xff\xd9"
overwrite = 0
/home/moin/moin-1.7-docbook/MoinMoin/action/AttachFile.py in add_attachment (request=<MoinMoin.request.request_fcgi.Request object>, pagename=u'DataImportTool', target=u'csvimp1.JPG', filecontent="\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x01\x00\x00\x00\x00\xff\xdb\x00C\x00\x08\x06\x06\x07\x06\x05\x08\x07\x07\x07\t\t\x08\n\x0c\x14\r\x0c\x0b\x0b\x0c\x19\x12...\x00\x9f\xa8\xff\x00\xef\xaa?\xe1'\xb0\xff\x00\x9f\xa8\xff\x00\xef\xaa9@\xe8h\xae{\xfe\x12{\x0f\xf9\xfa\x8f\xfe\xfa\xa3\xfe\x12{\x0f\xf9\xfa\x8f\xfe\xfa\xa2\xcc\x0f\xff\xd9", overwrite=0)
- 197
198 event = FileAttachedEvent(request, pagename, target, len(filecontent))
- 199 send_event(event)
- 200
- 201 return target
global send_event = <function send_event>
event = <MoinMoin.events.FileAttachedEvent object>
/home/moin/moin-1.7-docbook/MoinMoin/events/__init__.py in send_event (event=<MoinMoin.events.FileAttachedEvent object>)
- 240 # Try to handle the event with each available handler (for now)
- 241 for handle in cfg.event_handlers:
- 242 retval = handle(event)
- 243
244 assert retval is None or isinstance(retval, EventResult)
retval undefined
handle = <function handle>
event = <MoinMoin.events.FileAttachedEvent object>
/home/moin/moin-1.7-docbook/MoinMoin/events/emailnotify.py in handle (event=<MoinMoin.events.FileAttachedEvent object>)
- 162 return notify_subscribers(event.request, event.page, event.comment, True)
163 elif isinstance(event, ev.UserCreatedEvent):
- 164 return handle_user_created(event)
165 elif isinstance(event, ev.FileAttachedEvent):
- 166 return handle_file_attached(event)
global handle_file_attached = <function handle_file_attached>
event = <MoinMoin.events.FileAttachedEvent object>
/home/moin/moin-1.7-docbook/MoinMoin/events/emailnotify.py in handle_file_attached (event=<MoinMoin.events.FileAttachedEvent object>)
- 141
- 142 data = notification.attachment_added(request, _, event.pagename, event.filename, event.size)
- 143 data['body'] = data['body'] + links
- 144
- 145 emails = [usr.email for usr in subscribers[lang]]
data = {'attach_name': u'csvimp1.JPG', 'attach_size': 74364, 'editor': u'ptyler', 'page_name': u'DataImportTool', 'subject': u'New attachment added to page DataImportTool on xTuple', 'text': u'Dear Wiki user,\n\nYou have subscribed to a wiki p...achment name: csvimp1.JPG\nAttachment size: 74364\n'}
links = 'Attachment link: http://office.openmfg.com:88/Da...ink: http://office.openmfg.com:88/DataImportTool\n'
KeyError
- 'body'
- args = ('body',)
System Details
- Date: Mon, 21 Apr 2008 13:32:29 +0000
- Platform: Linux batch.openmfg.com 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686
- Python: Python 2.4.3 (/usr/bin/python)
MoinMoin: Release 1.7.0alpha (release)
Workaround
It basically works. Just hit Refresh on attachment page.
Discussion
Plan
- Priority:
- Assigned to:
- Status: can't reproduce in current version