[issue21027] difflib new cli interface

STINNER Victor report at bugs.python.org
Thu May 15 00:40:28 CEST 2014


STINNER Victor added the comment:

The HTML output contains an encoding in the <head>:
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

The problem is that sys.stdout may use a different encoding. For example, my locale encoding is UTF-8. So "python -m difflib -um a.py b.py > test.html" produces an HTML file encoded in UTF-8 but announcing a ISO 8859-1 header. There are different options to fix this issue:

* drop the --html command line option
* drop the invalid Content-Type header
* add an option to write the diff into a file, use UTF-8 to encode this file and emit a correct HTTP header (announce UTF-8)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21027>
_______________________________________


More information about the Python-bugs-list mailing list