Brett Cannon added the comment:
The code doing the sanity check for importlib can be found at
https://github.com/python/cpython/blob/f9f8e3ce709ceb15c8db8c8dde940daf1febf13d/Lib/importlib/_bootstrap.py#L943-L948
.
--
___
Python tracker
<ht
Brett Cannon added the comment:
Importllib code raising the exception is
https://github.com/python/cpython/blob/f9f8e3ce709ceb15c8db8c8dde940daf1febf13d/Lib/importlib/_bootstrap.py#L874-L876
.
--
___
Python tracker
<https://bugs.python.
Brett Cannon added the comment:
I think this should be an ImportError and so that means builtins.__import__()
is wrong. Anyone want to argue for the other side?
--
___
Python tracker
<https://bugs.python.org/issue37
Change by Brett Cannon :
--
title: relative import without parent -> relative import without parent
succeeds with builtins.__import__
___
Python tracker
<https://bugs.python.org/issu
Brett Cannon added the comment:
import.c code raising the exception:
https://github.com/python/cpython/blob/f9f8e3ce709ceb15c8db8c8dde940daf1febf13d/Python/import.c#L1675-L1677
--
___
Python tracker
<https://bugs.python.org/issue37
Brett Cannon added the comment:
If you run with `-Xdev`/warnings turned on you get an idea of what's happening:
>>> builtins.__import__('', globals(), locals(), ('foo',), 1)
:1: ImportWarning: can't resolve package from __spec__ or __package__,
fall
Change by Brett Cannon :
--
resolution: -> fixed
stage: patch review -> needs patch
status: open -> closed
___
Python tracker
<https://bugs.python.or
Brett Cannon added the comment:
Thanks for the PR, aeros167! BTW, if you want to open a new issue and modernize
the tests to use importlib directly that would be great!
--
___
Python tracker
<https://bugs.python.org/issue19
New submission from Brett Cannon :
ensurepip is using pkgutil.get_data() which isn't as clean as
importlib.resources for reading data from within a package.
--
components: Library (Lib)
messages: 346907
nosy: brett.cannon
priority: normal
severity: normal
stage: needs patch
s
Change by Brett Cannon :
--
nosy: +brett.cannon
___
Python tracker
<https://bugs.python.org/issue37459>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brett Cannon added the comment:
Would it be worth to set 'parent' to None in this instance? Might break code
but would also be potentially less surprising.
--
nosy: +brett.cannon
___
Python tracker
<https://bugs.python.o
Change by Brett Cannon :
--
stage: needs patch -> resolved
___
Python tracker
<https://bugs.python.org/issue37403>
___
___
Python-bugs-list mailing list
Un
Brett Cannon added the comment:
Bit surprised by the test_importlib failure. What has crept into there that
requires docstrings?
--
nosy: +brett.cannon
___
Python tracker
<https://bugs.python.org/issue37
Brett Cannon added the comment:
Thinking about this a bit, I my gut says having Path('.').name == '.' makes
more sense than returning ''. My reasoning is that in any case where there's a
single value -- e.g. Path('spam') -- you end up with the
Brett Cannon added the comment:
I'm going to close this as we try to avoid documenting CPython-specific details
unless absolutely necessary. And in the case of documenting the str type we
should avoid that.
So thanks for the suggestion, Dmitriy, but we will just leave this as a
ple
Change by Brett Cannon :
--
assignee: docs@python -> mdk
___
Python tracker
<https://bugs.python.org/issue37514>
___
___
Python-bugs-list mailing list
Un
Brett Cannon added the comment:
PEPs actually become historical documents once they are implemented, so could
you please check what the official docs say in regards to this to see if there
is an inconsistency in the semantics?
--
nosy: +brett.cannon
Change by Brett Cannon :
--
nosy: +eric.snow, ncoghlan
___
Python tracker
<https://bugs.python.org/issue37521>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brett Cannon added the comment:
Mind re-uploading the examples files with a more appropriate file name? (Saying
"import is f-'ed" is not motivating to those of us who wrote it to try and fix
this.)
--
___
Python tracker
<https
Change by Brett Cannon :
Removed file: https://bugs.python.org/file48460/importsfucked.zip
___
Python tracker
<https://bugs.python.org/issue37521>
___
___
Python-bug
Change by Brett Cannon :
Removed file: https://bugs.python.org/file48461/importsfucked.zip
___
Python tracker
<https://bugs.python.org/issue37521>
___
___
Python-bug
Brett Slatkin added the comment:
I believe the scope of this bug may be larger than it originally seemed.
Now that ProactorEventLoop is the default for Python 3.8
(https://bugs.python.org/issue34687), I'm seeing this same problem on Windows
when you try to call asyncio.new_event_loop()
Brett Cannon added the comment:
@joannah no clue if this ever happened. Could you check the code if
DeprecationWarning is being raised yet?
--
___
Python tracker
<https://bugs.python.org/issue26
Brett Cannon added the comment:
Thanks! I'll try to have a look when I can.
--
assignee: -> brett.cannon
___
Python tracker
<https://bugs.python.org
Brett Cannon added the comment:
So the issue is the lines assigning to sys.modules and loader.exec_module() are
reversed. Had you not done an import in your testext.__init__ you never would
have noticed, but since you are then the normal import system is noticing
there's nothi
Brett Cannon added the comment:
I will have a PR up shortly to fix the docs.
--
___
Python tracker
<https://bugs.python.org/issue37521>
___
___
Python-bug
Change by Brett Cannon :
--
keywords: +patch
pull_requests: +14519
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/14723
___
Python tracker
<https://bugs.python.org/issu
Brett Cannon added the comment:
Thanks for the report, Benjamin!
--
resolution: -> fixed
stage: patch review -> needs patch
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Brett Cannon :
--
nosy: +doko
___
Python tracker
<https://bugs.python.org/issue37577>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Brett Cannon :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Brett Cannon added the comment:
I'm not sure why you think importlib.util.module_from_spec() adds a module to
sys.modules?
https://docs.python.org/3/library/importlib.html#importlib.util.module_from_spec
doesn't say that nor does
https://github.com/python/cpython/blob/master/Lib
Change by Brett Cannon :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue37519>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brett Cannon added the comment:
Nope, loader.exec_module() doesn't either:
https://docs.python.org/3/library/importlib.html#importlib.abc.Loader.exec_module,
https://github.com/python/cpython/blob/master/Lib/importlib/_bootstrap_external.py#L776.
So unfortunately I'm still not
Brett Cannon added the comment:
The documentation is correct by not documenting the methods as they are not
meant to be used.
A warning could be added, but it requires new code to wrap the C function with
a DeprecationWarning since that code is currently shared between
Brett Cannon added the comment:
If you're using your example code for 'testext' that you uploaded then that's
expected because the import in your package causes a normal import which means
the import machinery is adding things to sys.modules. Try it with a plain
module
Change by Brett Cannon :
--
nosy: +brett.cannon
___
Python tracker
<https://bugs.python.org/issue37616>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Brett Cannon :
--
resolution: -> third party
___
Python tracker
<https://bugs.python.org/issue37617>
___
___
Python-bugs-list mailing list
Un
Brett Cannon added the comment:
Why would was want to swallow an exception? I think it would be better to let
the exception propagate.
--
nosy: +brett.cannon
___
Python tracker
<https://bugs.python.org/issue35
Brett Cannon added the comment:
I'm going to close this as this is more likely an Anaconda or path problem than
a CPython problem. But as Raymond said, chances are you have some other file
named bisect on your sys.path.
--
nosy: +brett.cannon
resolution: -> third par
New submission from Brett Cannon :
Or at least update the comment as the URL at
https://github.com/python/cpython/blob/master/Lib/venv/scripts/common/activate#L62
is a 404 and the domain seems to be a news site in Asia now
(http://www.zetadev.com/).
--
components: Library (Lib
Brett Cannon added the comment:
And this code and comment exists outside of just the bash activation script:
https://github.com/python/cpython/blob/master/Lib/venv/scripts/posix/activate.fish#L62
--
title: Drop support for Aspen magic directories in venv's activate script -&g
New submission from Brett Cannon :
If you look at
https://github.com/python/cpython/blob/master/Lib/venv/__init__.py#L112-L113
you will see that the prompt context for a virtual environment is always set.
Then if you look at the string substitutions for the activation scripts you
will also
Change by Brett Cannon :
--
nosy: +vinay.sajip
___
Python tracker
<https://bugs.python.org/issue37660>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Brett Cannon :
The upgrade_deps parameter to EnvBuilder exists and venv.EnvBuilder.create()
calls self.upgrade_dependencies(), but that method isn't documented anywhere.
--
messages: 348352
nosy: brett.cannon, vinay.sajip
priority: normal
severity: normal
s
New submission from Brett Cannon :
There are five activation scripts and they are all do things differently when
it comes to prompt manipulation. Standardizing on one set of semantics would
probably be good for consistency and so people know what to expect regardless
of their shell
Change by Brett Cannon :
--
priority: normal -> low
___
Python tracker
<https://bugs.python.org/issue37663>
___
___
Python-bugs-list mailing list
Unsubscrib
Change by Brett Cannon :
--
dependencies: +Drop support for Aspen magic directories in venv's activate
scripts, venv activation scripts erroneously check if __VENV_PROMPT__ is defined
___
Python tracker
<https://bugs.python.org/is
Change by Brett Cannon :
--
keywords: +patch
pull_requests: +14713
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/14941
___
Python tracker
<https://bugs.python.org/issu
New submission from Brett Cannon :
Right now the venv module directly reads the file system to find the activation
scripts and then copies them over. Moving over to importlib.resources would be
a more portable solution.
Unfortunately the venv API is specifically tied to the file system via
Brett Cannon added the comment:
It's deprecated: https://github.com/python/cpython/blob/master/Lib/imp.py#L31.
The wording is from back when the module was soft-deprecated via documentation
before it was hard-deprecated via code. Feel free to tweak it to say "The imp
module is dep
Brett Cannon added the comment:
I think you're reading "equivalence" too strictly here to mean "exactly the
same semantics". In this instance it means "for similar functionality, the
equivalent method is ..." (admittedly this might be a quirk of the use
Brett Cannon added the comment:
Anyone up for doing a PR that makes Path('.').name == '.'? It would be good to
see if that would break the stdlib as a proxy as to how many people might be
relying on these semantics. My hope is nothing breaks in which case we can make
t
Change by Brett Cannon :
--
nosy: +brett.cannon
___
Python tracker
<https://bugs.python.org/issue37689>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brett Cannon added the comment:
Changing the semantics of os.path.isdir() for something like this isn't worth
breaking code; basically it's now a quirk of the function.
--
___
Python tracker
<https://bugs.python.o
Change by Brett Cannon :
--
nosy: +brett.cannon
___
Python tracker
<https://bugs.python.org/issue37730>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brett Cannon added the comment:
This is the issue tracker for Python itself, not openpyxl, so this isn't the
right place to report this. I would go to openpyxl's website and see where they
specify to report bugs.
--
nosy: +brett.cannon
resolution: -> third party
stage:
New submission from Brett Cannon :
If you look at https://docs.python.org/3.9/py-modindex.html#cap-i you will see
that importlib.metadata isn't listed (same goes for the 3.8 docs).
Or are you leaving it out due to it being provisional?
--
assignee: docs@python
compo
Change by Brett Cannon :
--
assignee: -> brett.cannon
___
Python tracker
<https://bugs.python.org/issue37409>
___
___
Python-bugs-list mailing list
Unsubscrib
Change by Brett Cannon :
--
nosy: +jaraco
___
Python tracker
<https://bugs.python.org/issue37772>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Brett Cannon :
--
nosy: +vstinner
___
Python tracker
<https://bugs.python.org/issue37775>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Brett Cannon :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Brett Cannon added the comment:
If there's no porting benefit then let's move it to a single module instead of
a package.
--
___
Python tracker
<https://bugs.python.o
Brett Cannon added the comment:
If you look at
https://github.com/python/cpython/blob/master/Lib/importlib/_bootstrap.py and
https://github.com/python/cpython/blob/master/Lib/importlib/_bootstrap_external.py
you will notice a bunch of comments near all the calls to load_module(). Those
are
Brett Cannon added the comment:
What commands did you use to launch this build? (E.g. I noticed you are trying
to do a PGO build.)
--
nosy: +brett.cannon
___
Python tracker
<http://bugs.python.org/issue30
Brett Cannon added the comment:
Three things.
One, the imp module is deprecated, so please don't use it.
Two, all undocumented functions in the imp module are considered unsupported,
so double-please don't use imp.load_package(). :)
Three, we can't look at that patch wit
Changes by Brett Cannon :
--
title: imp.py: load_package: function has a buggy loop with `path =
os.path.join(path, '__init__'+extension)` -> imp.py: load_package() appends to
its own loop variable
___
Python tracker
<http:/
Brett Cannon added the comment:
Go for it, Cheryl!
--
___
Python tracker
<http://bugs.python.org/issue27485>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brett Cannon added the comment:
Yes, we're as corporate as an open source project that doesn't have enough
funding to be able to defend against a lawsuit but is big enough that simply
shutting down would really suck for millions of people. ;) Anyway, your CLA
signing came through
Brett Cannon added the comment:
Past Python details should not be included in docstrings; it should simply
represent the current code.
--
nosy: +brett.cannon, eric.snow
___
Python tracker
<http://bugs.python.org/issue30
Changes by Brett Cannon :
--
resolution: -> fixed
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue30436>
___
Brett Cannon added the comment:
New changeset 8c3f05e9f0f0b30a3d4a2433e92471794d8258af by Brett Cannon (Milan
Oberkirch) in branch 'master':
bpo-30436: Raise ModuleNotFoundError for importlib.util.find_spec() when parent
isn't a package (GH-1899)
https://github.com/python
Brett Cannon added the comment:
Yep, core-workflow work has superseded this issue.
--
resolution: -> out of date
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
Brett Cannon added the comment:
So is PR 2035 a fix for this? This discussion on this exact problem seems to
have ended up spanning a couple issues and a PR so I'm losing track of where
things sit at the moment.
--
___
Python tracker
Brett Cannon added the comment:
And hence why you proposed having a counter of 128 (or some number) to prevent
the infinite recursion.
I think this has gotten sufficiently complicated and into the bowels of CPython
itself it might make sense to ask for a reviewer from python-committers (I
Brett Cannon added the comment:
Should this be closed since the all PRs got merged?
--
___
Python tracker
<http://bugs.python.org/issue30604>
___
___
Python-bug
Brett Cannon added the comment:
So is this a bug in Python or a problem with the website? If it's the former
then the title is misleading and we should clarify it, and if it's the latter
this should be closed as "third party".
--
Brett Cannon added the comment:
New changeset c38e32a10061a7c6d54e7e53ffabf7af7998f045 by Brett Cannon
(Alexandru Ardelean) in branch 'master':
bpo-30645: don't append to an inner loop path in imp.load_package() (GH-2268)
https://github.com/python
Changes by Brett Cannon :
--
pull_requests: +2413
___
Python tracker
<http://bugs.python.org/issue30645>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Brett Cannon :
--
pull_requests: +2414
___
Python tracker
<http://bugs.python.org/issue30645>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brett Cannon added the comment:
New changeset 9db3ae045dd462a2da2e016c44231de1befd1f87 by Brett Cannon in
branch '3.6':
[3.6] bpo-30645: don't append to an inner loop path in imp.load_package()
(GH-2268) (#2364)
https://github.com/python/cpython/commit/9db3ae045dd462a2da2e016c4
Brett Cannon added the comment:
New changeset 599ff020b308113f3709fd4e623d9f0d08511706 by Brett Cannon in
branch '3.5':
[3.5] bpo-30645: don't append to an inner loop path in imp.load_package()
(GH-2268) (GH-2365)
https://github.com/python
Brett Cannon added the comment:
Just an FYI that I have never managed to make this work.
--
___
Python tracker
<http://bugs.python.org/issue11978>
___
___
Pytho
Changes by Brett Cannon :
--
resolution: -> fixed
stage: -> resolved
status: open -> closed
versions: +Python 3.5
___
Python tracker
<http://bugs.python.or
Changes by Brett Cannon :
--
assignee: brett.cannon ->
___
Python tracker
<http://bugs.python.org/issue11978>
___
___
Python-bugs-list mailing list
Unsubscrib
New submission from Brett Cannon:
Title says it all.
--
messages: 296797
nosy: brett.cannon, pitrou
priority: normal
severity: normal
status: open
title: Update `make patchcheck` to understand Misc/NEWS.d
___
Python tracker
<http://bugs.python.
Changes by Brett Cannon :
--
resolution: -> fixed
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue30750>
___
Brett Cannon added the comment:
Why do you want an index of *just* decorators? The documentation is structured
so you look for the module that probably contains a solution to your problem
and then you see what the module may have (which may have a solution that isn't
a decorator). Ju
Changes by Brett Cannon :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue30772>
___
___
Brett Cannon added the comment:
Both staticmethod and contextmanager are in the index under "S" and "C". But if
you mean they were hard to discover, having them under a list of decorators
wouldn't have necessarily helped since, as we pointed out, you may get misled
Brett Cannon added the comment:
And thanks for at least bringing the idea forward, Tom.
--
___
Python tracker
<http://bugs.python.org/issue30787>
___
___
Pytho
Brett Cannon added the comment:
My guess is the import of package has completed but package.submodule hasn't (I
don't know what state it would be in, but obviously before the module is
assigned as an attribute on the package), a context switch occurs, and then the
assignment fa
Brett Cannon added the comment:
So this is very old semantics from the Python 2 days. I think Nick's idea of
transforming the import to `import pkg.mod` when pkg isn't in sys.modules is
probably the simplest, cleanest solution if we're going
Changes by Brett Cannon :
--
priority: normal -> low
___
Python tracker
<http://bugs.python.org/issue30841>
___
___
Python-bugs-list mailing list
Unsubscrib
Changes by Brett Cannon :
--
type: compile error -> enhancement
___
Python tracker
<http://bugs.python.org/issue30841>
___
___
Python-bugs-list mailing list
Un
Brett Cannon added the comment:
I just wanted to say thanks to everyone who helped to fix this bug. The locking
situation in import is probably the trickiest part of it and has also been
tweaked the most as of late and so solving these kinds of issues is tricky
New submission from Brett Cannon:
Based on all the work currently going into fixing the locking situation for
imports, it's probably a good idea to expose it publicly so others can use it.
--
components: Library (Lib)
messages: 298077
nosy: brett.cannon
priority: normal
sev
Changes by Brett Cannon :
--
dependencies: +importlib: _find_and_load() race condition on sys.modules[name]
check
___
Python tracker
<http://bugs.python.org/issue30
Changes by Brett Cannon :
--
nosy: +eric.snow, ncoghlan
___
Python tracker
<http://bugs.python.org/issue30893>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brett Cannon added the comment:
Those pages all work for me. May have been transient.
--
nosy: +brett.cannon
resolution: -> out of date
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
Brett Cannon added the comment:
I agree with Antoine that this shouldn't change. Having said that, it
wouldn't be hard to write your own finder using importlib that doesn't get
the directory contents and instead checks for the file directly (and you
could even set it just for y
2201 - 2300 of 5934 matches
Mail list logo