How can you make python 2.x warn when coercing strings to unicode?

前端 未结 2 373
长发绾君心
长发绾君心 2021-01-19 10:40

A very common source of encoding errors is that python 2 will silently coerce strings to unicode when you add them together with unicode. This can

2条回答
  •  温柔的废话
    2021-01-19 11:15

    That error isn't cryptic at all. I can gather from it that urllib.quote() (with is called by quote_plus()) doesn't handle unicode very well. Some quick googling and I've found this previous SO question asking for unicode safe alternatives. Unfortunately, none seem to exist.

提交回复
热议问题