[issue36056] importlib does not support pathlib

2019-02-20 Thread Berker Peksag
Change by Berker Peksag : -- resolution: -> not a bug type: -> enhancement ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue36056] importlib does not support pathlib

2019-02-20 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: I close this issue, it's not a bug. -- nosy: +matrixise status: open -> closed ___ Python tracker ___ ___

[issue36056] importlib does not support pathlib

2019-02-20 Thread Dylan Lloyd
Dylan Lloyd added the comment: Whoops, yes, that of course makes sense. My mistake. Thanks! -- resolution: not a bug -> status: closed -> open type: enhancement -> ___ Python tracker __

[issue36056] importlib does not support pathlib

2019-02-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I concur with Berker. Since the argument of importlib.import_module() is not a path, pathlib.Path is not valid here. It is uncommon in Python to check the type of arguments explicitly. pathlib.Path is not more special than list or tkinter.Button.

[issue36056] importlib does not support pathlib

2019-02-20 Thread Berker Peksag
Change by Berker Peksag : -- nosy: +remi.lapeyre status: pending -> open ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue36056] importlib does not support pathlib

2019-02-20 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the report, but importlib.import_module() doesn't accept a path of a Python module: https://docs.python.org/3/library/importlib.html#importlib.import_module So, the correct way to use the API is: import importlib importlib.import_modul

[issue36056] importlib does not support pathlib

2019-02-20 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: This is also present in 3.7 and 3.8. I would look at it and propose a patch tomorrow. -- nosy: +remi.lapeyre versions: +Python 3.7, Python 3.8 ___ Python tracker _

[issue36056] importlib does not support pathlib

2019-02-20 Thread Dylan Lloyd
New submission from Dylan Lloyd : ``` ❯ python -c 'import pathlib; import importlib; importlib.import_module(pathlib.Path("poc.py"))' Traceback (most recent call last): File "", line 1, in File "~/.conda/envs/py3.6/lib/python3.6/importlib/__init__.py", line 117, in import_module if nam