Edgewall Software

Ticket #1112 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

attachments with spaces in filename

Reported by: bitserf@… Owned by: cmlenz
Priority: normal Milestone: 0.9
Component: general Version: 0.8
Severity: normal Keywords:
Cc:

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

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

Change History

Changed 4 years ago by bitserf@…

patch to fix viewing of attachments with spaces in the filename

Changed 4 years ago by anonymous

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..

Changed 4 years ago by bitserf@…

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

Changed 3 years ago by cmlenz

  • owner changed from jonas to cmlenz
  • status changed from new to assigned
  • milestone set to 0.9

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

Changed 3 years ago by cmlenz

  • status changed from assigned to closed
  • resolution set to fixed

Fixed in [1443].

Add/Change #1112 (attachments with spaces in filename)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.