`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:

- ca0fad2cbb
- f5d4878992
- 7d68e88d31
- 1fee400dcd

This supersedes https://github.com/home-assistant/home-assistant/pull/29893.
pull/29906/head
Bas Nijholt 2019-12-13 09:47:09 +01:00 committed by Paulus Schoutsen
parent 5b32ee566c
commit c59bf0bff6
1 changed files with 1 additions and 1 deletions

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