Python doctests and unicode

前端 未结 1 615
小蘑菇
小蘑菇 2021-01-13 15:51

I have a code base that runs unchanged in Python 2.7 and 3.2+. But the doctests in the documentation rst files are giving me a headache. When I run them in Python2, I get

1条回答
  •  时光说笑
    2021-01-13 16:30

    Make sure you are using Python 3.3. It added the explicit u'unicode literals' -- i.e. with u prefix again -- to ease the transition between Python 2 with unicode literals and Python 3. See http://docs.python.org/3/whatsnew/3.3.html#pep-414-explicit-unicode-literals

    0 讨论(0)
提交回复
热议问题