Discuss / Python / 3.5及以上版本警告

3.5及以上版本警告

Topic source

遥望君山

#1 Created at ... [Delete] [Delete and Lock User]

HTMLParser 有默认参数convert_charrefs,需要手工设成False,否则样例代码的 handle_entityref 方法不会起作用:

If convert_charrefs is True (the default), all character references (except the ones in script/style elements) are automatically converted to the corresponding Unicode characters.

摘自 Python 官方文档


  • 1

Reply