Modify ↓
Opened 10 years ago
Closed 10 years ago
#12369 closed defect (fixed)
KeyError: 'attachment'
| Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.0.11 |
| Component: | attachment | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: |
Attachment upload POST request without an attachment raises a |
||
| API Changes: | |||
| Internal Changes: | |||
Description
From the logs:
2016-02-09 23:59:35,811 Trac[main] ERROR: Internal Server Error: <RequestWithSession "POST '/attachment/wiki/space ship/?action=new'">, referrer None
Traceback (most recent call last):
File "/usr/local/virtualenv/1.0-stable/lib/python2.7/site-packages/trac/web/main.py", line 554, in _dispatch_request
dispatcher.dispatch(req)
File "/usr/local/virtualenv/1.0-stable/lib/python2.7/site-packages/trac/web/main.py", line 247, in dispatch
resp = chosen_handler.process_request(req)
File "/usr/local/virtualenv/1.0-stable/lib/python2.7/site-packages/trac/attachment.py", line 529, in process_request
data = self._do_save(req, attachment)
File "/usr/local/virtualenv/1.0-stable/lib/python2.7/site-packages/trac/attachment.py", line 706, in _do_save
upload = req.args['attachment']
KeyError: 'attachment'
Attachments (0)
Change History (4)
comment:1 by , 10 years ago
| Owner: | set to |
|---|---|
| Status: | new → assigned |
comment:3 by , 10 years ago
| Release Notes: | modified (diff) |
|---|
That sounds good. I'll implement that change.
comment:4 by , 10 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Committed to 1.0-stable in [14581], merged to trunk in [14582:14583].
Note:
See TracTickets
for help on using tickets.



I can reproduce the issue using curl:
Proposed change:
trac/attachment.py
I'll add a test case.