On 03/06/2021 18:14, Senthil Kumaran wrote:
On Thu, Jun 03, 2021 at 09:55:57AM -0700, Guido van Rossum wrote:
Maybe this?
04732ca993 bpo-43105: Importlib now resolves relative paths when creating
module spec objects from file locations (GH-25121)
Likely!. But
https://github.com/python/cpython/commit/04732ca993fa077a8b9640cc77fb2f152339585a
was supposed to a platform specific bug fix.
I didn't a sense that reportlab regression detected was platform
specific one. The behavior change is an interesting one though.
The regression may well be a platform issue. I am by no means an expert at building python; I followed a recipe from the
ARCH PKGBUILD of some time past so perhaps there are problems from my incompetence.
More interesting thing for me was developers running large test suites
between alpha and beta releases, and reporting bugs! :-)
You guys can certainly develop language changes faster than us maintainers can use them; the dead hand of past usage is
a real handicap.
I have managed a smaller example which breaks for me in arch linux latest.
The self contained code is here
https://www.reportlab.com/ftp/timport-310b1.py
I switched to using importlib.import_module as I think that can now always be
used in the versions we support.
To generate a test base I used an empty directory and then run (in bash)
for d in A B;do rm -rf $d; mkdir $d;echo "print('+++++ in module %s' % __name__)" > $d/$(echo $d | tr [:upper:]
[:lower:]).py; done
or
$ for d in A B;do
> rm -rf $d
> mkdir $d
> echo "print('+++++ in module %s' % __name__)" \
> > $d/$(echo $d | tr [:upper:] [:lower:]).py
> done
to create two simple modules in dirs A & B.
If I run python timport-310b1.py in 3.10.0a7 I occasionally see a problem, but in 3.10.0b1 or b2 I see the problem every
time; the TB ends like this
print(recursiveImport(mn, debug=1))
File "/home/robin/devel/reportlab/REPOS/timpbug/tests/timport-310b1.py", line
36, in recursiveImport
return importlib.import_module(modulename)
File
"/home/robin/devel/reportlab/.py310/lib/python3.10/importlib/__init__.py", line
126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'a'
The occasional problem with 3.10.0a7 make me think some random element is at
work perhaps hashing stuff.
--
Robin Becker
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at
https://mail.python.org/archives/list/python-dev@python.org/message/UJKVOAR6BUDOIFRSUGQ3THFA2DYG47PQ/
Code of Conduct: http://python.org/psf/codeofconduct/