Kevin Keating added the comment:
One possible solution here would be to update the documentation at
https://github.com/python/cpython/blob/master/Doc/library/importlib.rst#implementing-lazy-imports
to either note the limitation or to modify the lazy_import function so that it
adds
Kevin Keating added the comment:
Brett, what do you mean by "the way import works"? Is the difference between
using LazyLoader and using a normal import intentional?
--
status: -> open
___
Python tracker
<https://bugs.pytho
Kevin Keating added the comment:
My colleague just tested this on Mac and confirms that the bug also occurs
there using Python 3.8.3.
--
___
Python tracker
<https://bugs.python.org/issue42
Kevin Keating added the comment:
An __init__.py shouldn't be necessary. If I comment out the 'b =
lazy_import("foo.b")' line in a.py (i.e. disable the lazy import), then the
print statement works correctly as written without any other changes.
Also, I double checked with the col
New submission from Kevin Keating :
Steps to reproduce:
Create the following three files (or download the attached zip file, which
contains these files):
main.py
import foo
from foo import a
from foo import b
print(foo.b.my_function())
foo/a.py
import importlib.util
Kevin Keating added the comment:
Running the msi from an elevated command prompt worked. Thanks!
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Kevin Keating added the comment:
Yeah, I only run into this problem if I install Python 2.7.13 into C:\Program
Files\Python27. If I install Python 2.7.12 or 3.6.1 to the same location, then
everything works fine. I can successfully install Python 2.7.13 to
C:\Python27, C:\Programs\Python27
Kevin Keating added the comment:
Here's the log file. I'm assuming that the relevant bit starts at around line
18663:
CAQuietExec: Collecting setuptools
CAQuietExec: Collecting pip
CAQuietExec: Installing collected packages: setuptools, pip
CAQuietExec: Exception:
CAQuietExec: Traceback
New submission from Kevin Keating:
If I use the Python 64-bit 2.7.13 Windows installer and install to C:\Program
Files\Python27, then the Scripts folder doesn't get created and pip doesn't get
installed. If I uninstall Python and reinstall it to C:\Python27,
C:\Programs\Python27, or "C:
Kevin Keating added the comment:
I agree that None is an unwise value to pass in. Of the four different abspath
implementations, though, one will treat None (or any falsey value) as an empty
string, while the other three will raise an exception unless passed an actual
str or bytes object. I
New submission from Kevin Keating:
On Windows, os.path.abspath() treats None as if it were an empty string, so
os.path.abspath(None) returns the current working directory. On Linux,
os.path.abspath(None) raises an AttributeError. With macpath, abspath(None)
raises a TypeError. I've seen
Kevin Keating added the comment:
I just realized that even the behavior of ntpath.abspath() is inconsistent
across platforms. On Windows, ntpath.abspath(None) returns the current working
directory. On other OSs, ntpath.abspath(None) raises a TypeError. There are
two different abspath
12 matches
Mail list logo