Michael Hall has proposed merging lp:~mhall119/loco-directory/fixes-613333 into 
lp:loco-directory.

Requested reviews:
  loco-directory-dev (loco-directory-dev)
Related bugs:
  #613333 UnicodeEncodeError: 'ascii' codec can't encode character u'\u0161' in 
position 27: ordinal not in range(128), HTTP response headers must be in 
US-ASCII format 
  https://bugs.launchpad.net/bugs/613333


Creates ascii-safe file attachment names for HTTP headers
-- 
https://code.launchpad.net/~mhall119/loco-directory/fixes-613333/+merge/31857
Your team loco-directory-dev is requested to review the proposed merge of 
lp:~mhall119/loco-directory/fixes-613333 into lp:loco-directory.
=== modified file 'loco_directory/events/views.py'
--- loco_directory/events/views.py	2010-07-31 16:19:29 +0000
+++ loco_directory/events/views.py	2010-08-05 16:37:43 +0000
@@ -48,7 +48,7 @@
     """Return any list events as an ical"""
     filename = "%s.ics" % name.replace(' ', '-').lower()
     response = HttpResponse(mimetype='text/calendar')
-    response['Content-Disposition'] = 'attachment; filename=%s' % filename
+    response['Content-Disposition'] = 'attachment; filename=%s' % filename.encode('ascii', 'replace')
     response.write('''BEGIN:VCALENDAR
 PRODID:-//loco.ubuntu.com//EN
 VERSION:2.0

_______________________________________________
Mailing list: https://launchpad.net/~loco-directory-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~loco-directory-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to