diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2015-03-14 23:18:47 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2015-03-14 23:18:47 (GMT) |
commit | 102029dfd645123244437dee6fc8c0f72125433b (patch) | |
tree | 5afa2e1185862e22b95ea6aa8f5d0b614852a287 /Doc | |
parent | fbd011dd4982b883d18039f494475022fc2d0cc6 (diff) | |
download | cpython-102029dfd645123244437dee6fc8c0f72125433b.zip cpython-102029dfd645123244437dee6fc8c0f72125433b.tar.gz cpython-102029dfd645123244437dee6fc8c0f72125433b.tar.bz2 |
Issue #2052: Add charset parameter to HtmlDiff.make_file().
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/difflib.rst | 7 | ||||
-rw-r--r-- | Doc/whatsnew/3.5.rst | 8 |
2 files changed, 14 insertions, 1 deletions
diff --git a/Doc/library/difflib.rst b/Doc/library/difflib.rst index 329bde0..4427065 100644 --- a/Doc/library/difflib.rst +++ b/Doc/library/difflib.rst @@ -104,7 +104,8 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module. The following methods are public: - .. method:: make_file(fromlines, tolines, fromdesc='', todesc='', context=False, numlines=5) + .. method:: make_file(fromlines, tolines, fromdesc='', todesc='', context=False, \ + numlines=5, *, charset='utf-8') Compares *fromlines* and *tolines* (lists of strings) and returns a string which is a complete HTML file containing a table showing line by line differences with @@ -123,6 +124,10 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module. the next difference highlight at the top of the browser without any leading context). + .. versionchanged:: 3.5 + *charset* keyword-only argument was added. The default charset of + HTML document changed from ``'ISO-8859-1'`` to ``'utf-8'``. + .. method:: make_table(fromlines, tolines, fromdesc='', todesc='', context=False, numlines=5) Compares *fromlines* and *tolines* (lists of strings) and returns a string which diff --git a/Doc/whatsnew/3.5.rst b/Doc/whatsnew/3.5.rst index 2f79848..21fafd0 100644 --- a/Doc/whatsnew/3.5.rst +++ b/Doc/whatsnew/3.5.rst @@ -225,6 +225,14 @@ contextlib don't provide any options to redirect it. (Contributed by Berker Peksag in :issue:`22389`.) +difflib +------- + +* The charset of the HTML document generated by :meth:`difflib.HtmlDiff.make_file` + can now be customized by using *charset* keyword-only parameter. The default + charset of HTML document changed from ``'ISO-8859-1'`` to ``'utf-8'``. + (Contributed by Berker Peksag in :issue:`2052`.) + distutils --------- |