This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author BTaskaya
Recipients BTaskaya
Date 2020-01-12.12:58:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1578833882.54.0.425753104323.issue39311@roundup.psfhosted.org>
In-reply-to
Content
>>> tuple(difflib.context_diff(["abc"], ["bcd"], fromfile=Path("example.py")))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.9/difflib.py", line 1254, in context_diff
    _check_types(a, b, fromfile, tofile, fromfiledate, tofiledate, lineterm)
  File "/usr/local/lib/python3.9/difflib.py", line 1301, in _check_types
    raise TypeError('all arguments must be str, not: %r' % (arg,))
TypeError: all arguments must be str, not: PosixPath('example.py')

IMHO to and from file arguments should accept PathLike objects. If agreed I can prepare a patch.
History
Date User Action Args
2020-01-12 12:58:02BTaskayasetrecipients: + BTaskaya
2020-01-12 12:58:02BTaskayasetmessageid: <1578833882.54.0.425753104323.issue39311@roundup.psfhosted.org>
2020-01-12 12:58:02BTaskayalinkissue39311 messages
2020-01-12 12:58:02BTaskayacreate