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.
This commit is contained in:
Bas Nijholt 2019-12-13 09:47:09 +01:00 committed by Paulus Schoutsen
parent 5b32ee566c
commit c59bf0bff6

View File

@ -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