Brett Cannon added the comment:
What about if there isn't a pre-computed location for __file__? I could imagine
a self-contained CPython build where there is no concept of a file location on
disk for anything using this.
--
___
Python tracker
New submission from Brett Cannon :
There's some inaccuracies when it comes to iterable and iterators (async and
not). See
https://mail.python.org/archives/list/python-...@python.org/thread/3W7TDX5KNVQVGT5CUHBK33M7VNTP25DZ/#3W7TDX5KNVQVGT5CUHBK33M7VNTP25DZ
for background.
Should probably
Brett Cannon added the comment:
I decided that find_spec() saying something wasn't available in a finder made
sense even though it was because a zip file no longer existed as the loader
would still fail as appropriate.
--
resolution: -> fixed
stage: patch review -> resolved
Brett Cannon added the comment:
New changeset e1bdecb6dc7ac33256d5fa875d45634512d2a90e by Brett Cannon in
branch '3.10':
[3.10] bpo-45183: don't raise an exception when calling
zipimport.zipimporter.find_spec() when the zip file is missing and the internal
cache has been reset (GH-28435
Change by Brett Cannon :
--
pull_requests: +26843
pull_request: https://github.com/python/cpython/pull/28438
___
Python tracker
<https://bugs.python.org/issue45
Brett Cannon added the comment:
New changeset 209b7035f714dcc41df054b0b023e0b955d7e1a2 by Brett Cannon in
branch 'main':
bpo-45183: don't raise an exception when calling
zipimport.zipimporter.find_spec() when the zip file is missing and the internal
cache has been reset (GH-28435)
https
Brett Cannon added the comment:
The proposed fix seems to be the right one based on my reading of the code.
--
keywords: -patch
stage: patch review ->
___
Python tracker
<https://bugs.python.org/issu
Change by Brett Cannon :
--
keywords: +patch
pull_requests: +26840
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/28435
___
Python tracker
<https://bugs.python.org/issu
Change by Brett Cannon :
--
assignee: -> brett.cannon
___
Python tracker
<https://bugs.python.org/issue45183>
___
___
Python-bugs-list mailing list
Unsubscrib
Brett Cannon added the comment:
New changeset a390bb6d66027517498e75b6b91a91be5f136d28 by Miss Islington (bot)
in branch '3.10':
bpo-42135 Correct version slated for importlib.find_loader removal (GH-28312)
(GH-28321)
https://github.com/python/cpython/commit
Brett Cannon added the comment:
New changeset 9f93018b69d72cb48d3444554261ae3b0ea00c93 by Hugo van Kemenade in
branch 'main':
bpo-42135 Correct version slated for importlib.find_loader removal (GH-28312)
https://github.com/python/cpython/commit/9f93018b69d72cb48d3444554261ae3b0ea00c93
Brett Cannon added the comment:
No progress as I've been swamped with higher-priority things and the bigger
discussion about how we want to manage the stdlib going forward has not started
yet (once again, not had the time to start
Brett Cannon added the comment:
> set __file__ (and __path__) on frozen modules?
See https://bugs.python.org/issue21736
--
___
Python tracker
<https://bugs.python.org/issu
Brett Cannon added the comment:
Add Lukasz to get his opinion on this idea.
--
nosy: +lukasz.langa
___
Python tracker
<https://bugs.python.org/issue44
Brett Cannon added the comment:
So first, don't import from threads. It's non-deterministic as you have seen.
You should do all imports **before** you start running multi-threaded code if
multiple threads are going to access the
Second, tossing in pickle is just asking for more trouble
Change by Brett Cannon :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Brett Cannon added the comment:
New changeset 80f33f266b4ad5925a3e58ea3a54ae139a6b6f0e by William Chargin in
branch 'main':
bpo-41706: Fix special method invocation docs to mention using type() (GH-22084)
https://github.com/python/cpython/commit/80f33f266b4ad5925a3e58ea3a54ae139a6b6f0e
Brett Cannon added the comment:
> Maybe this can be revisited now.
I've started the work already (albeit rather slowly ). Importlib has been
updated to prefer __spec__.parent of __package__ and warns when the values are
not equal. Next step will be to raise an ImportWarning when __packag
Brett Cannon added the comment:
> After so long a reason came up that prevents the movement of tests of ctypes,
> lib2to3, and idlelib (which even continues in the same folder, only the
> nomenclature was changed)?
Time and energy.
--
_
Change by Brett Cannon :
--
nosy: +brett.cannon
___
Python tracker
<https://bugs.python.org/issue20109>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brett Cannon added the comment:
No idea, I was just trying to understand what the link was meant to point at. :)
--
___
Python tracker
<https://bugs.python.org/issue31
Brett Cannon added the comment:
Did you mean to link to a fork, Irit?
--
status: pending -> open
___
Python tracker
<https://bugs.python.org/issue31772>
___
_
Brett Cannon added the comment:
> Has there been any resolution regarding `sortTestMethodsUsing`?
My suspicion is if the docs don't suggest there's something else then nothing
has been changed.
--
___
Python tracker
<https://bugs.pyth
Change by Brett Cannon :
--
nosy: -brett.cannon
___
Python tracker
<https://bugs.python.org/issue44070>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brett Cannon added the comment:
New changeset 726c931b3896dc73fd156e2340b5ef0b8f55cfb7 by Ammar Askar in branch
'master':
bpo-43888: Remove coverage builds from CI (GH-25679)
https://github.com/python/cpython/commit/726c931b3896dc73fd156e2340b5ef0b8f55cfb7
Change by Brett Cannon :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Brett Cannon :
--
keywords: +patch
pull_requests: +24283
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/25563
___
Python tracker
<https://bugs.python.org/issu
Brett Cannon added the comment:
It might be time to just kill the coverage report since people are obviously
not looking at the results.
--
___
Python tracker
<https://bugs.python.org/issue43
Brett Cannon added the comment:
Darn, forgot about Windows when I hunted down all the warnings on macOS.
--
assignee: -> brett.cannon
___
Python tracker
<https://bugs.python.org/issu
Brett Cannon added the comment:
Are you still planning to fix this, Barry?
--
___
Python tracker
<https://bugs.python.org/issue37741>
___
___
Python-bugs-list m
Brett Cannon added the comment:
Much like the question about load_module(), replacing find_module() with
find_spec() can be helped with things like
importlib.util.spec_from_file_location() and .spec_from_loader()
(https://docs.python.org/3/library/importlib.html
Brett Cannon added the comment:
> would you accept a PR that changes the changelog entry to contain the
> ".find_spec() not found; falling back to find_module()" message, for better
> search-ability?
Sure!
> Also, could you please explain how to migrate to f
Change by Brett Cannon :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Brett Cannon added the comment:
New changeset 57c6cb5100d19a0e0218c77d887c3c239c9ce435 by Brett Cannon in
branch 'master':
bpo-42135: Deprecate implementations of find_module() and find_loader()
(GH-25169)
https://github.com/python/cpython/commit/57c6cb5100d19a0e0218c77d887c3c239c9ce435
Change by Brett Cannon :
--
nosy: -brett.cannon
___
Python tracker
<https://bugs.python.org/issue43728>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Brett Cannon :
--
keywords: +patch
pull_requests: +23935
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/25169
___
Python tracker
<https://bugs.python.org/issu
Change by Brett Cannon :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Brett Cannon added the comment:
New changeset dc6d3e1e4c0c1e4b2210edab8fb4762569dc2936 by Brett Cannon in
branch 'master':
bpo-43720: Update import-related stdlib deprecation messages to say they will
be removed in Python 3.12 (GH-25167)
https://github.com/python/cpython/commit
Change by Brett Cannon :
--
pull_requests: +23910
pull_request: https://github.com/python/cpython/pull/25169
___
Python tracker
<https://bugs.python.org/issue2
Change by Brett Cannon :
--
assignee: -> brett.cannon
___
Python tracker
<https://bugs.python.org/issue42135>
___
___
Python-bugs-list mailing list
Unsubscrib
Brett Cannon added the comment:
find_spec() also supercedes find_loader().
--
___
Python tracker
<https://bugs.python.org/issue42135>
___
___
Python-bugs-list m
Change by Brett Cannon :
--
keywords: +patch
pull_requests: +23908
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/25167
___
Python tracker
<https://bugs.python.org/issu
New submission from Brett Cannon :
The following module's have preexisting deprecations with no slated removal
version. Since so much of import is getting cleaned up in Python 3.12, these
should finally go as well so the APIs are consistent across Python.
- imp
- pkgutil
- importlib.util
Change by Brett Cannon :
--
title: [importlib] Deprecate find_module() implementations -> [importlib]
Deprecate find_module() & find_loader() mplementations
___
Python tracker
<https://bugs.python.org/
Change by Brett Cannon :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Brett Cannon added the comment:
New changeset f97dc800689ba98783dac8dc51f87f7c6f413ac6 by Brett Cannon in
branch 'master':
bpo-43672: raise ImportWarning when calling find_loader() (GH-25119)
https://github.com/python/cpython/commit/f97dc800689ba98783dac8dc51f87f7c6f413ac6
Brett Cannon added the comment:
> What I've never really got clear in my mind is how dotted names get handled.
Essentially:
1. Check if parent is imported; if not then import (working your way all the
way back to the top if necessary)
2. Ask the sys.meta_path finders if they can han
Change by Brett Cannon :
--
assignee: brett.cannon -> docs@python
nosy: +docs@python
___
Python tracker
<https://bugs.python.org/issue43697>
___
___
Python-
Brett Cannon added the comment:
> I'm not sure where namespace packages are documented
https://docs.python.org/3/reference/import.html#namespace-packages
> I'm not at all sure what would happen if we have meta path finders A and B
> on sys.meta_path in that order, and A.find_spec
Brett Cannon added the comment:
There is no mechanism as the entire concept of a namespace package is
implemented in importlib.machinery.PathFinder itself and not the generic import
system (see
https://github.com/python/cpython/blob/652bfdee9495dca241d48278742fe035b7a82bdb/Lib/importlib
Change by Brett Cannon :
--
keywords: +patch
pull_requests: +23863
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/25119
___
Python tracker
<https://bugs.python.org/issu
Change by Brett Cannon :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
New submission from Brett Cannon :
Using find_loader() in the import system should raise ImportWarning to start
transitioning people over to find_spec() who haven't migrated since Python 3.4.
--
assignee: brett.cannon
components: Interpreter Core
messages: 389834
nosy: brett.cannon
Brett Cannon added the comment:
New changeset a7ff6df60c05e1b69fca743573b1e118bebf121d by Brett Cannon in
branch 'master':
bpo-42134: Raise ImportWarning when calling find_module() in the import system
(GH-25044)
https://github.com/python/cpython/commit
Change by Brett Cannon :
--
assignee: -> brett.cannon
___
Python tracker
<https://bugs.python.org/issue42134>
___
___
Python-bugs-list mailing list
Unsubscrib
Change by Brett Cannon :
--
keywords: +patch
pull_requests: +23792
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/25044
___
Python tracker
<https://bugs.python.org/issu
Change by Brett Cannon :
--
assignee: brett.cannon ->
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python
Brett Cannon added the comment:
New changeset 1899087b21119c5c64cd41619b542c0bf0ab5751 by Brett Cannon in
branch 'master':
bpo-42136: Deprecate module_repr() as found in importlib (GH-25022)
https://github.com/python/cpython/commit/1899087b21119c5c64cd41619b542c0bf0ab5751
Change by Brett Cannon :
--
assignee: -> brett.cannon
___
Python tracker
<https://bugs.python.org/issue42136>
___
___
Python-bugs-list mailing list
Unsubscrib
Change by Brett Cannon :
--
keywords: +patch
pull_requests: +23772
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/25022
___
Python tracker
<https://bugs.python.org/issu
Change by Brett Cannon :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Brett Cannon added the comment:
New changeset 9cb31d671646a5ff0901f79d2d61022621447190 by Brett Cannon in
branch 'master':
bpo-42137: have ModuleType.__repr__ prefer __spec__ over module_repr()
(GH-24953)
https://github.com/python/cpython/commit/9cb31d671646a5ff0901f79d2d61022621447190
Change by Brett Cannon :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Brett Cannon :
--
pull_requests: +23752
pull_request: https://github.com/python/cpython/pull/24994
___
Python tracker
<https://bugs.python.org/issue43
Brett Cannon added the comment:
Meant to say, "existence of the _method_ isn't problematic".
--
___
Python tracker
<https://bugs.python.org/issue42137>
___
__
Change by Brett Cannon :
--
assignee: docs@python -> brett.cannon
stage: patch review ->
___
Python tracker
<https://bugs.python.org/issue43573>
___
___
Change by Brett Cannon :
--
keywords: +patch
pull_requests: +23733
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/24974
___
Python tracker
<https://bugs.python.org/issu
Change by Brett Cannon :
--
keywords: +patch
pull_requests: +23711
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/24953
___
Python tracker
<https://bugs.python.org/issu
Change by Brett Cannon :
--
dependencies: -[importlib] deprecate module_repr() methods
___
Python tracker
<https://bugs.python.org/issue42137>
___
___
Python-bug
Brett Cannon added the comment:
Thinking about it more, raising ImportWarning (or DeprecationWarning) is
unnecessarily noisy as the existence of the module isn't problematic, it just
won't be used anymore in the future. So updating the code to use __spec__ first
and then document in "W
New submission from Brett Cannon :
https://docs.python.org/3/library/types.html#types.ModuleType does not document
__spec__.
--
assignee: docs@python
components: Documentation
messages: 389204
nosy: brett.cannon, docs@python
priority: normal
severity: normal
status: open
title: [types
Brett Cannon added the comment:
Should try to use __spec__ first, but if it isn't set then fall back on
module_repr() and raise an ImportWarning. See
Lib/importlib/_bootstrap.py:_module_repr.
--
___
Python tracker
<https://bugs.python.
Brett Cannon added the comment:
The documentation states in the deprecation notice for
https://docs.python.org/3/library/importlib.html#importlib.abc.Loader.load_module
that create_module() and exec_module() are what are necessary. But the it
isn't a direct 1:1 replacement and people
Brett Cannon added the comment:
Having `test_pkg.test_submodule` be set after your import based on the sequence
of imports your example executes is entirely expected and a side-effect of how
import is (at least now) designed. So I disagree with the assessment "that
nothing
Brett Cannon added the comment:
Thanks for the clarification! I think I understand what's going on now, and the
logic is actually expected.
When you do `from .test_submodule import *`, Python must first import
`test_pkg.test_submodule` in order to get you the object for the `import *`
part
Brett Cannon added the comment:
Sorry, I'm having a hard time following what you've written and I unfortunately
don't have time to examine your (I assume) .tar.xz file. When you say
"directory-based-module", do you mean a package (e.g. `__init__.py` in a
directory)? It's
Brett Cannon added the comment:
Thanks, Victor! And I will independently say that my use of
sys.stdlib_module_names suggests the list seems accurate(and is useful)!
--
___
Python tracker
<https://bugs.python.org/issue43
New submission from Brett Cannon :
I noticed that _xxsubinterpreters is in sys.stdlib_module_names but none of the
other `_xx` modules are included (nor is 'test'). Since _xxsubinterpreters is
only meant for testing (ATM) I think it should probably be left out.
--
components: Library
Change by Brett Cannon :
--
versions: +Python 3.10 -Python 3.8
___
Python tracker
<https://bugs.python.org/issue14678>
___
___
Python-bugs-list mailing list
Unsub
Change by Brett Cannon :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Brett Cannon :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Brett Cannon added the comment:
New changeset cc02b4f2e810ab524d845daa18bc94df5b092dd8 by Alex in branch
'master':
bpo-38302: __pow__/__rpow__ now called when __ipow__ returns NotImplemented
(#16459)
https://github.com/python/cpython/commit/cc02b4f2e810ab524d845daa18bc94df5b092dd8
Change by Brett Cannon :
--
pull_requests: +23367
pull_request: https://github.com/python/cpython/pull/24587
___
Python tracker
<https://bugs.python.org/issue38
Brett Cannon added the comment:
Since this is still open I would assume it never made it in.
--
___
Python tracker
<https://bugs.python.org/issue28007>
___
___
Brett Cannon added the comment:
I would harmonize towards what the concrete implementations are doing since
people who don't implement the defaults will get the appropriate results
regardless. An entry in What's New will cover any potential notification of the
change since you can't exactly
Brett Cannon added the comment:
I'm totally fine with pushing this until b1 since this has been broken for
ages.
--
___
Python tracker
<https://bugs.python.org/issue38
Brett Cannon added the comment:
Thanks for the idea, Stefan, but I'm going to close this as something we don't
want to do. `importlib.reload()` purposefully takes a module object as that's
what is going to get mutated/changed and it must already exist. The other
importlib functions take
Brett Cannon added the comment:
New changeset ca8e96d1edbeb536f58da91e607082463398fce1 by Miss Islington (bot)
in branch '3.8':
bpo-42811: Update importlib.utils.resolve_name() docs to use __spec__.parent
(GH-24100) (GH-24144)
https://github.com/python/cpython/commit
Brett Cannon added the comment:
importlib is probably not os.PathLike-clean due to its bootstrapping
restrictions of not getting to use anything implemented in Python from 'os'
(i.e. if it isn't being managed in posixmodule.c then it probably won't work).
If you follow the traceback it's
Change by Brett Cannon :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Brett Cannon :
--
title: Update docs for importlib.util.resolve_name() to use __spec__ instead of
__package__ -> Update docs for importlib.util.resolve_name() to use
__spec__.parent instead of __package__
___
Python tracker
<
Change by Brett Cannon :
--
nosy: -brett.cannon
___
Python tracker
<https://bugs.python.org/issue17343>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Brett Cannon :
--
nosy: -brett.cannon
___
Python tracker
<https://bugs.python.org/issue29708>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Brett Cannon :
--
versions: -Python 3.10, Python 3.9
___
Python tracker
<https://bugs.python.org/issue40059>
___
___
Python-bugs-list mailin
New submission from Brett Cannon :
Since importlib now prefers `__spec__` over `__package__`,
https://docs.python.org/3/library/importlib.html#importlib.util.resolve_name
should be updated to use `__spec__.parent` instead in the. example.
--
assignee: brett.cannon
components
Change by Brett Cannon :
--
nosy: -brett.cannon
___
Python tracker
<https://bugs.python.org/issue42667>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brett Cannon added the comment:
Your question is best directed at https://discuss.python.org/c/core-workflow/8,
Daniel.
--
___
Python tracker
<https://bugs.python.org/issue39
Change by Brett Cannon :
--
nosy: -brett.cannon
___
Python tracker
<https://bugs.python.org/issue42125>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brett Cannon added the comment:
What is "VendorImporter" (see the message of the ImportWarning)? That's not in
the stdlib, so it looks like your system is injecting something via some `.pth`
file or environment variable that doesn't define e
Brett Cannon added the comment:
You could propose your backwards-incompatible proposals on python-ideas, Greg,
and see if you get any uptake.
--
___
Python tracker
<https://bugs.python.org/issue42
101 - 200 of 5790 matches
Mail list logo