Author graingert
Recipients graingert, gregory.p.smith, jamesls, lukasz.langa, omnios, steve.dower
Date 2021-07-15.12:01:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
hello, just chiming in to let you know that this broke CI on twisted: (As above for Chalice, I think this didn't actually break the framework itself, just the tests for the framework. )

do you know what the correct usage of importlib.util.spec_from_file_location is to match importlib.import_module ?

I have a tree like this:

└── mypkg
    └── __pycache__
        ├── __init__.cpython-38.pyc
        └── __init__.cpython-39.pyc

2 directories, 4 files

but I'm not sure how to get a spec for ./mypkg/

Python 3.9.6 (default, Jul  3 2021, 16:40:50) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/usr/lib/', '/usr/lib/python3.9', '/usr/lib/python3.9/lib-dynload', '/usr/local/lib/python3.9/dist-packages', '/usr/lib/python3/dist-packages']
>>> import os
>>> os.getcwd()
>>> import importlib.util
>>> importlib.util.spec_from_file_location(name="mypkg.demo", location="mypkg/")
ModuleSpec(name='mypkg.demo', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7fc94644bfd0>, origin='mypkg/')
>>> import mypkg.demo
>>> mypkg.demo.__spec__
ModuleSpec(name='mypkg.demo', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7fc94645a160>, origin='/home/graingert/projects/syspath-tests/mypkg/')
Date User Action Args
2021-07-15 12:01:23graingertsetrecipients: + graingert, gregory.p.smith, lukasz.langa, steve.dower, jamesls, omnios
2021-07-15 12:01:23graingertsetmessageid: <>
2021-07-15 12:01:23graingertlinkissue44070 messages
2021-07-15 12:01:23graingertcreate