#5663: markdown 1.6b unicodedecodeerror
-------------------------------------------------------------------+--------
          Reporter:  Koen Biermans <[EMAIL PROTECTED]>  |         Owner:  
mboersma
            Status:  reopened                                      |     
Milestone:          
         Component:  Contrib apps                                  |       
Version:  SVN     
        Resolution:                                                |      
Keywords:  markdown
             Stage:  Accepted                                      |     
Has_patch:  1       
        Needs_docs:  0                                             |   
Needs_tests:  0       
Needs_better_patch:  0                                             |  
-------------------------------------------------------------------+--------
Changes (by Daniel Pope <[EMAIL PROTECTED]>):

  * status:  closed => reopened
  * resolution:  fixed =>

Comment:

 The patch works for 1.6a and earlier because 1.6b is the first to provide
 markdown.version, so 1.6a is passed UTF-8 bytestrings.

 There is no 1.6b1. I've just downloaded the official 1.6b .zip file:
 {{{
 mauve:~/dev/markdown$ diff markdown-1.6b/markdown.py /var/lib/python-
 support/python2.5/markdown.py
 mauve:~/dev/markdown$
 }}}
 The -1 in the 1.6b-1 package version is the version of the package, not
 the version of markdown.

 I can confirm by empirical testing that 1.6b does require unicode strings
 as input. Your memory has failed you in this case.

 {{{
 >>> i = '€£½'.decode('utf8')
 >>> i
 u'\u20ac\xa3\xbd'
 >>> markdown.markdown(i)
 u'<p>\u20ac\xa3\xbd\n</p>'
 >>> markdown.markdown(i.encode('utf8'))
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "markdown.py", line 1722, in markdown
     return md.convert(text)
   File "markdown.py", line 1614, in convert
     self.source = removeBOM(self.source, self.encoding)
   File "markdown.py", line 74, in removeBOM
     if text.startswith(bom):
 UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 0:
 ordinal not in range(128)
 }}}

 1.6a works with or without the patch.
 1.6b works only with the patch (even if it does contain bugs).
 1.6b1 works only with the patch.
 1.7 works with or without the patch.

 I don't see what we could be doing better. Even if there's an issue
 upstream it doesn't affect the status of this patch. Reopening.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/5663#comment:13>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to