From c59bf0bff6eb9f5edfba4272f6b5f80b1634167f Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Fri, 13 Dec 2019 09:47:09 +0100 Subject: [PATCH] `genericpath` is an internal Python module and shouldn't be imported according to core Python devs. (see [this](https://bugs.python.org/msg358136) comment) (#29903) For a reason unknown to me, @exxamalte introduced this in https://github.com/home-assistant/home-assistant/pull/14342. The problem is that Linux and macOS implement `os.path` differently, one imports from [`ntpath.py`](https://github.com/python/cpython/blob/master/Lib/ntpath.py) and the other one from [`posixpath.py`](https://github.com/python/cpython/blob/master/Lib/posixpath.py), and both these files use `genericpath.py`. Somehow, `isort` on macOS will see `genericpath` as a third party library and sort it accordingly. Other Unix-based OSes will correctly treat `genericpath` as an internal library. This problem led to a sorting sequence in the following commits: - ca0fad2cbb0544125d87d21ffe308cf3addcde5a - f5d4878992d63683d3da661ef02ae7b51421beb4 - 7d68e88d31246e268db809225e3d924acb1fc352 - 1fee400dcd94229db56a2ada5e3c335aa139146f This supersedes https://github.com/home-assistant/home-assistant/pull/29893. --- tests/components/feedreader/test_init.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/components/feedreader/test_init.py b/tests/components/feedreader/test_init.py index bffbe9676fa..62412e53900 100644 --- a/tests/components/feedreader/test_init.py +++ b/tests/components/feedreader/test_init.py @@ -1,8 +1,8 @@ """The tests for the feedreader component.""" from datetime import timedelta -from genericpath import exists from logging import getLogger from os import remove +from os.path import exists import time import unittest from unittest import mock