#250 CSV table fails on Python 2 with Unicode delimiter, quote, or escape char

sandbox
closed-accepted
nobody
None
5
2014-03-20
2014-03-11
No

because docutils dpes stuff like str(options['quote']), which tries to encode unicode strings using the ASCII codec in python 2.

a fix would be to replace all str calls with this:

def unicode2str(unic):
    """encodes a unicode string on python 2 to a bytestring (str in python2)
    and leaves it be on python3 (because it’s already a str there)"""
    return unic.encode('utf-8') if sys.version_info.major < 3 else unic

bug #249 only occus after fixing this one

Discussion

  • Günter Milde

    Günter Milde - 2014-03-20

    Thanks for the report.

    This is fixed in SVN revision 7746. However, the related bug 249 cannot not be fixed with reasonable effort.

     
  • Günter Milde

    Günter Milde - 2014-03-20
    • summary: CSV table fails on python 2 with unicode --> CSV table fails on Python 2 with Unicode delimiter, quote, or escape char
    • status: open --> closed-accepted
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks