Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

#1112 closed defect (fixed)

attachments with spaces in filename

Reported by: bitserf@… Owned by: Christopher Lenz
Priority: normal Milestone: 0.9
Component: general Version: 0.8
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

hi,

when clicking the ticket link to view/download an attachment with a space or other special character in the file name, Trac fails with an "attachment not found" error, though the attachment exists on the filesystem.

this would appear to be because the filename still contains URL encoded components, and File.py doesn't unescape the filename it gets.

i've created a patch that works here, though i'm not sure that its at the correct place, perhaps the unescaping should occur earlier.

Attachments (2)

trac-0.8-attachments.patch (526 bytes ) - added by bitserf@… 19 years ago.
patch to fix viewing of attachments with spaces in the filename
trac-0.8-attachments-r2.patch (715 bytes ) - added by bitserf@… 19 years ago.
updated version of patch which allows encoded and unencoded filename (bit of a HACK)

Download all attachments as: .zip

Change History (5)

by bitserf@…, 19 years ago

Attachment: trac-0.8-attachments.patch added

patch to fix viewing of attachments with spaces in the filename

comment:1 by anonymous, 19 years ago

woops,

it seems that quoting occurs explicitly just before that line, sorry :)

is it new behaviour in 0.8 to always URL encode the file name, even on the filesystem? all our existing tickets created with 0.7.1 (with a few hundred attachments) still use raw unencoded filenames on the filesystem, an upgrade didn't seem to fix this..

by bitserf@…, 19 years ago

updated version of patch which allows encoded and unencoded filename (bit of a HACK)

comment:2 by Christopher Lenz, 19 years ago

Milestone: 0.9
Owner: changed from Jonas Borgström to Christopher Lenz
Status: newassigned

I guess we should just fallback to unquoted filenames if the quoted version isn't found.

comment:3 by Christopher Lenz, 19 years ago

Resolution: fixed
Status: assignedclosed

Fixed in [1443].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christopher Lenz.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christopher Lenz to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.