#1848 Error on attachment with unicode name

v1.0.0
closed
sf-1 (616)
General
nobody
2015-08-20
2011-03-31
No

https://sourceforge.net/p/usi2011/tickets/27/

Module /var/local/allura/Allura/allura/templates/widgets/post_widget.html:43 in top-level template code
<<              <div class="attachment_thumb" style="min-height: 130px;">
                     {% if att.is_image() %}
                       <a href="{{att.url()}}"><img src="{{att.url()}}/thumb"/></a>
                       <br/>
                       <a href="{{att.url()}}">{{att.filename}}</a>
>>  <a href="{{att.url()}}"><img src="{{att.url()}}/thumb"/></a>
Module allura.model.discuss:472 in url
<<      def url(self):
               if self.post_id:
                   return self.post.url() + 'attachment/' + urllib.quote(self.filename)
               elif self.thread_id:
                   return self.thread.url() + 'attachment/' + urllib.quote(self.filename)
>>  return self.post.url() + 'attachment/' + urllib.quote(self.filename)
Module urllib:1222 in quote
<<              safe_map[c] = (c in safe) and c or ('%%%02X' % i)
               _safemaps[cachekey] = safe_map
           res = map(safe_map.__getitem__, s)
           return ''.join(res)
>>  res = map(safe_map.__getitem__, s)
KeyError: u'\u2019'

Discussion

  • Dave Brondsema

    Dave Brondsema - 2011-03-31
    • size: --> 1
     
  • Dave Brondsema

    Dave Brondsema - 2011-03-31

    helper function for urllib quoting that is unicode safe would be great

     
  • Jenny Steele - 2011-04-01
    • assigned_to: Jenny Steele
     
  • Jenny Steele - 2011-04-04
    • status: open --> in-progress
     
  • Jenny Steele - 2011-04-04

    I fixed this by changing all the urllib.quote uses we still had to use the already existing urlquote helper.

     
  • Jenny Steele - 2011-04-04
    • status: in-progress --> code-review
    • assigned_to: Jenny Steele --> Rick Copéland
     
  • Rick Copeland - 2011-04-04
    • status: code-review --> closed
     

Log in to post a comment.