[issue45020] Freeze all modules imported during startup.

2021-09-22 Thread Brett Cannon


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 
<https://bugs.python.org/issue45020>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45250] Make sure documentation is accurate for what an (async) iterable and (async) iterator are

2021-09-20 Thread Brett Cannon


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 check:

1. The glossary.
2. Language reference.
3. Built-ins.

This applies to iter()/__iter__/iterable, next()/__next__/iterator, and their 
async equivalents.

--
assignee: brett.cannon
components: Documentation
messages: 402276
nosy: brett.cannon
priority: normal
severity: normal
status: open
title: Make sure documentation is accurate for what an (async) iterable and 
(async) iterator are

___
Python tracker 
<https://bugs.python.org/issue45250>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45183] Unexpected exception with zip importer

2021-09-17 Thread Brett Cannon


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
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue45183>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45183] Unexpected exception with zip importer

2021-09-17 Thread Brett Cannon


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) (#28438)
https://github.com/python/cpython/commit/e1bdecb6dc7ac33256d5fa875d45634512d2a90e


--

___
Python tracker 
<https://bugs.python.org/issue45183>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45183] Unexpected exception with zip importer

2021-09-17 Thread Brett Cannon


Change by Brett Cannon :


--
pull_requests: +26843
pull_request: https://github.com/python/cpython/pull/28438

___
Python tracker 
<https://bugs.python.org/issue45183>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45183] Unexpected exception with zip importer

2021-09-17 Thread Brett Cannon


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://github.com/python/cpython/commit/209b7035f714dcc41df054b0b023e0b955d7e1a2


--

___
Python tracker 
<https://bugs.python.org/issue45183>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45183] Unexpected exception with zip importer

2021-09-17 Thread Brett Cannon


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/issue45183>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45183] Unexpected exception with zip importer

2021-09-17 Thread Brett Cannon


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/issue45183>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45183] Unexpected exception with zip importer

2021-09-15 Thread Brett Cannon


Change by Brett Cannon :


--
assignee:  -> brett.cannon

___
Python tracker 
<https://bugs.python.org/issue45183>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42135] [importlib] Deprecate find_module() & find_loader() mplementations

2021-09-13 Thread Brett Cannon


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/a390bb6d66027517498e75b6b91a91be5f136d28


--

___
Python tracker 
<https://bugs.python.org/issue42135>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42135] [importlib] Deprecate find_module() & find_loader() mplementations

2021-09-13 Thread Brett Cannon


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


--

___
Python tracker 
<https://bugs.python.org/issue42135>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40059] Provide a toml module in the standard library

2021-09-08 Thread Brett Cannon


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 that).

--

___
Python tracker 
<https://bugs.python.org/issue40059>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45020] Freeze all modules imported during startup.

2021-08-31 Thread Brett Cannon


Brett Cannon  added the comment:

> set __file__ (and __path__) on frozen modules?

See https://bugs.python.org/issue21736

--

___
Python tracker 
<https://bugs.python.org/issue45020>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44972] Add workflow_dispatch trigger for GitHub Actions jobs

2021-08-23 Thread Brett Cannon


Brett Cannon  added the comment:

Add Lukasz to get his opinion on this idea.

--
nosy: +lukasz.langa

___
Python tracker 
<https://bugs.python.org/issue44972>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44916] Random behaviour when importing two modules with the same name but different source files

2021-08-16 Thread Brett Cannon

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. 

The key thing to know is the master copy of a module is kept in `sys.modules`. 
But classes keep a reference to the module they were loaded from, not what 
`sys.modules` happens to have at that moment. So due to threading indeterminism 
it's quite possible to end up unpickling in such a way that the module that 
eventually ends up in `sys.modules` is not what your unpickled class is 
referencing.

As such, I'm closing as "wont fix".

--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue44916>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41706] docs: operator dunder (`__add__`, et al.) invocations described incorrectly

2021-08-04 Thread Brett Cannon


Change by Brett Cannon :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue41706>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41706] docs: operator dunder (`__add__`, et al.) invocations described incorrectly

2021-08-04 Thread Brett Cannon


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


--
nosy: +brett.cannon

___
Python tracker 
<https://bugs.python.org/issue41706>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33277] Deprecate __loader__, __package__, __file__, and __cached__ on modules

2021-08-04 Thread Brett Cannon

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 __package__ is 
defined but __spec__.parent is not (then DeprecationWarning after that).

For __loader__ I got Python 3.10 to fall back on to __spec__.loader. Next step 
is https://bugs.python.org/issue42132 to update C code to set __spec__ where 
appropriate. From there the check for equivalence can go in (which then leads 
to the warnings).

I have not started with __cached__ yet, so next step is making sure all uses 
fall back on __spec__.

So, to be clear, the steps I have been following are:

1. Make sure all code falls back on __spec__ when appropriate (one release)
2. Raise an ImportWarning when values differ (one release)
3. Make __spec__ take precedence over old attribute (one release)
4. Raise an ImportWarning when having to fall back to older attribute (two 
releases)
5. Raise a DeprecationWarning when falling back on older attribute (two 
releases)
6. Clean up code

--

___
Python tracker 
<https://bugs.python.org/issue33277>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10572] Move test sub-packages to Lib/test

2021-07-16 Thread Brett Cannon


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.

--

___
Python tracker 
<https://bugs.python.org/issue10572>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20109] TestProgram is mentioned in the unittest docs but is not documented

2021-06-22 Thread Brett Cannon


Change by Brett Cannon :


--
nosy: +brett.cannon

___
Python tracker 
<https://bugs.python.org/issue20109>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31772] SourceLoader uses stale bytecode in case of equal mtime seconds

2021-06-18 Thread Brett Cannon


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/issue31772>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31772] SourceLoader uses stale bytecode in case of equal mtime seconds

2021-06-17 Thread Brett Cannon


Brett Cannon  added the comment:

Did you mean to link to a fork, Irit?

--
status: pending -> open

___
Python tracker 
<https://bugs.python.org/issue31772>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2021-05-26 Thread Brett Cannon


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.python.org/issue1717>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44070] __file__ is now fully qualified in 3.8 and 3.9

2021-05-08 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 
<https://bugs.python.org/issue44070>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43888] GitHub Actions CI/CD `Coverage` job is broken on master

2021-04-30 Thread Brett Cannon


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


--

___
Python tracker 
<https://bugs.python.org/issue43888>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43864] [Windows] test_importlib logs: DeprecationWarning: WindowsRegistryFinder.find_module() is deprecated and slated for removal in Python 3.12; use find_spec() instead

2021-04-24 Thread Brett Cannon


Change by Brett Cannon :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue43864>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43864] [Windows] test_importlib logs: DeprecationWarning: WindowsRegistryFinder.find_module() is deprecated and slated for removal in Python 3.12; use find_spec() instead

2021-04-23 Thread Brett Cannon


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/issue43864>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43888] GitHub Actions CI/CD `Coverage` job is broken on master

2021-04-19 Thread Brett Cannon


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/issue43888>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43864] [Windows] test_importlib logs: DeprecationWarning: WindowsRegistryFinder.find_module() is deprecated and slated for removal in Python 3.12; use find_spec() instead

2021-04-16 Thread Brett Cannon


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/issue43864>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37741] importlib.metadata docs not showing up in the module index

2021-04-14 Thread Brett Cannon


Brett Cannon  added the comment:

Are you still planning to fix this, Barry?

--

___
Python tracker 
<https://bugs.python.org/issue37741>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43540] importlib: Document how to replace load_module() in What's New in Python 3.10

2021-04-08 Thread Brett Cannon

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#importlib.util.spec_from_file_location
 and 
https://docs.python.org/3/library/importlib.html#importlib.util.spec_from_loader),
 but there isn't a 1:1 swap, so it will take some thought.

And the docs in importlib for things like find_module() say to implement 
find_spec() which then mentions spec_from_loader() may be useful.

As for replicating the subprocess docs approach, that's a little different 
since those alternatives in the stdlib are not going anywhere while the stuff 
in importlib is going to be gone in 3.12 so it will only last for two years.

And BTW I took care of six for you knowing you were going to ask about it if I 
didn't. 

--

___
Python tracker 
<https://bugs.python.org/issue43540>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42134] Raise ImportWarning when falling back to find_module()

2021-04-08 Thread Brett Cannon


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 find_spec() in 
> https://docs.python.org/3.10/whatsnew/3.10.html#porting-to-python-3-10 ? I'd 
> do that, but I don't know yet what is the proper way.

The problem is it will possibly vary from class to class. You can probably get 
pretty far with 
https://docs.python.org/3/library/importlib.html#importlib.util.spec_from_file_location
 or 
https://docs.python.org/3/library/importlib.html#importlib.util.spec_from_loader
 depending.

--

___
Python tracker 
<https://bugs.python.org/issue42134>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42135] [importlib] Deprecate find_module() & find_loader() mplementations

2021-04-06 Thread Brett Cannon


Change by Brett Cannon :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue42135>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42135] [importlib] Deprecate find_module() & find_loader() mplementations

2021-04-06 Thread Brett Cannon


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


--

___
Python tracker 
<https://bugs.python.org/issue42135>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43728] Change the exception type and message raised when _curses is not found.

2021-04-05 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 
<https://bugs.python.org/issue43728>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42135] [importlib] Deprecate find_module() & find_loader() mplementations

2021-04-05 Thread Brett Cannon


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/issue42135>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43720] Document various preexisting stdlib deprecations related to import for removal in Python 3.12

2021-04-03 Thread Brett Cannon


Change by Brett Cannon :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue43720>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43720] Document various preexisting stdlib deprecations related to import for removal in Python 3.12

2021-04-03 Thread Brett Cannon


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/dc6d3e1e4c0c1e4b2210edab8fb4762569dc2936


--

___
Python tracker 
<https://bugs.python.org/issue43720>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2135] Restructure import.c into PEP 302 importer objects

2021-04-03 Thread Brett Cannon


Change by Brett Cannon :


--
pull_requests: +23910
pull_request: https://github.com/python/cpython/pull/25169

___
Python tracker 
<https://bugs.python.org/issue2135>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42135] [importlib] Deprecate find_module() & find_loader() mplementations

2021-04-03 Thread Brett Cannon


Change by Brett Cannon :


--
assignee:  -> brett.cannon

___
Python tracker 
<https://bugs.python.org/issue42135>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42135] [importlib] Deprecate find_module() & find_loader() mplementations

2021-04-03 Thread Brett Cannon


Brett Cannon  added the comment:

find_spec() also supercedes find_loader().

--

___
Python tracker 
<https://bugs.python.org/issue42135>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43720] Document various preexisting stdlib deprecations related to import for removal in Python 3.12

2021-04-03 Thread Brett Cannon


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/issue43720>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43720] Document various preexisting stdlib deprecations related to import for removal in Python 3.12

2021-04-03 Thread Brett Cannon


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

--
assignee: brett.cannon
components: Library (Lib)
messages: 390141
nosy: brett.cannon
priority: normal
severity: normal
status: open
title: Document various preexisting stdlib deprecations related to import for 
removal in Python 3.12
versions: Python 3.10

___
Python tracker 
<https://bugs.python.org/issue43720>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42135] [importlib] Deprecate find_module() & find_loader() mplementations

2021-04-02 Thread Brett Cannon


Change by Brett Cannon :


--
title: [importlib] Deprecate find_module() implementations -> [importlib] 
Deprecate find_module() & find_loader() mplementations

___
Python tracker 
<https://bugs.python.org/issue42135>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43672] Raise ImportWarning when calling find_loader()

2021-04-02 Thread Brett Cannon


Change by Brett Cannon :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue43672>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43672] Raise ImportWarning when calling find_loader()

2021-04-02 Thread Brett Cannon


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


--

___
Python tracker 
<https://bugs.python.org/issue43672>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43697] Importlib documentation does not cover how meta path finders should handle namespace packages

2021-04-01 Thread Brett Cannon

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 handle the module
3. Use the loader from the spec
4. Add the imported module as an attribute on the parent

If you start from 
https://github.com/python/cpython/blob/master/Lib/importlib/__init__.py#L108 
you can see how it all works. The Python code is actually not that complicated, 
especially if you ignore all the old PEP 302 compatibility code .

--

___
Python tracker 
<https://bugs.python.org/issue43697>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43697] Importlib documentation does not cover how meta path finders should handle namespace packages

2021-04-01 Thread Brett Cannon


Change by Brett Cannon :


--
assignee: brett.cannon -> docs@python
nosy: +docs@python

___
Python tracker 
<https://bugs.python.org/issue43697>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43697] Importlib documentation does not cover how meta path finders should handle namespace packages

2021-04-01 Thread Brett Cannon

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("foo.bar") returns a spec, 
> but A.find_spec("foo") doesn't and B.find_spec("foo") does.

Nothing special. The import system just asks the meta path finder whether they 
can handle a module, and if they return a spec they can, if they don't then 
they can't. So it is of no concern whether two different meta path importers 
handle the same package for whatever reason. A successful import is a 
successful import. 

--

___
Python tracker 
<https://bugs.python.org/issue43697>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43697] Importlib documentation does not cover how meta path finders should handle namespace packages

2021-04-01 Thread Brett Cannon


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/_bootstrap_external.py#L1339-L1369).
 So at the sys.meta_path level, the entire concept of namespace packages isn't 
even a thing; namespace packages only exist because FileFinder itself makes 
namespace package possible.

--

___
Python tracker 
<https://bugs.python.org/issue43697>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43672] Raise ImportWarning when calling find_loader()

2021-03-31 Thread Brett Cannon


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/issue43672>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42134] Raise ImportWarning when falling back to find_module()

2021-03-30 Thread Brett Cannon


Change by Brett Cannon :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue42134>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43672] Raise ImportWarning when calling find_loader()

2021-03-30 Thread Brett Cannon


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
priority: normal
severity: normal
status: open
title: Raise ImportWarning when calling find_loader()
versions: Python 3.10

___
Python tracker 
<https://bugs.python.org/issue43672>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42134] Raise ImportWarning when falling back to find_module()

2021-03-30 Thread 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/a7ff6df60c05e1b69fca743573b1e118bebf121d


--

___
Python tracker 
<https://bugs.python.org/issue42134>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42134] Raise ImportWarning when falling back to find_module()

2021-03-29 Thread Brett Cannon


Change by Brett Cannon :


--
assignee:  -> brett.cannon

___
Python tracker 
<https://bugs.python.org/issue42134>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42134] Raise ImportWarning when falling back to find_module()

2021-03-27 Thread Brett Cannon


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/issue42134>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42136] [importlib] deprecate module_repr() methods

2021-03-26 Thread Brett Cannon


Change by Brett Cannon :


--
assignee: brett.cannon -> 
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue42136>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42136] [importlib] deprecate module_repr() methods

2021-03-26 Thread Brett Cannon


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


--

___
Python tracker 
<https://bugs.python.org/issue42136>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42136] [importlib] deprecate module_repr() methods

2021-03-26 Thread Brett Cannon


Change by Brett Cannon :


--
assignee:  -> brett.cannon

___
Python tracker 
<https://bugs.python.org/issue42136>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42136] [importlib] deprecate module_repr() methods

2021-03-25 Thread Brett Cannon


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/issue42136>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42137] Prefer using __spec__ over module_repr() for ModuleType.__repr__

2021-03-24 Thread Brett Cannon


Change by Brett Cannon :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue42137>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42137] Prefer using __spec__ over module_repr() for ModuleType.__repr__

2021-03-24 Thread Brett Cannon


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


--

___
Python tracker 
<https://bugs.python.org/issue42137>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43573] [types] Document __spec__ for types.ModuleType

2021-03-23 Thread Brett Cannon


Change by Brett Cannon :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue43573>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43573] [types] Document __spec__ for types.ModuleType

2021-03-23 Thread Brett Cannon


Change by Brett Cannon :


--
pull_requests: +23752
pull_request: https://github.com/python/cpython/pull/24994

___
Python tracker 
<https://bugs.python.org/issue43573>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42137] Prefer using __spec__ over module_repr() for ModuleType.__repr__

2021-03-22 Thread Brett Cannon


Brett Cannon  added the comment:

Meant to say, "existence of the _method_ isn't problematic".

--

___
Python tracker 
<https://bugs.python.org/issue42137>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43573] [types] Document __spec__ for types.ModuleType

2021-03-22 Thread Brett Cannon


Change by Brett Cannon :


--
assignee: docs@python -> brett.cannon
stage: patch review -> 

___
Python tracker 
<https://bugs.python.org/issue43573>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43573] [types] Document __spec__ for types.ModuleType

2021-03-22 Thread Brett Cannon


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/issue43573>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42137] Prefer using __spec__ over module_repr() for ModuleType.__repr__

2021-03-20 Thread Brett Cannon


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/issue42137>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42137] Prefer using __spec__ over module_repr() for ModuleType.__repr__

2021-03-20 Thread Brett Cannon


Change by Brett Cannon :


--
dependencies:  -[importlib] deprecate module_repr() methods

___
Python tracker 
<https://bugs.python.org/issue42137>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42137] Prefer using __spec__ over module_repr() for ModuleType.__repr__

2021-03-20 Thread Brett Cannon


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 "What's New" should be good enough.

--
assignee:  -> brett.cannon
title: Raise an ImportWarning for calling module_repr() on loaders -> Prefer 
using __spec__ over module_repr() for ModuleType.__repr__

___
Python tracker 
<https://bugs.python.org/issue42137>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43573] [types] Document __spec__ for types.ModuleType

2021-03-20 Thread Brett Cannon


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] Document __spec__ for types.ModuleType
versions: Python 3.10, Python 3.8, Python 3.9

___
Python tracker 
<https://bugs.python.org/issue43573>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42137] Raise an ImportWarning for calling module_repr() on loaders

2021-03-20 Thread Brett Cannon


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.org/issue42137>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43540] importlib: Document how to replace load_module() in What's New in Python 3.10

2021-03-18 Thread Brett Cannon


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 are expected to use all of the helper 
code so it's going to be very specific to the need of the code.

--

___
Python tracker 
<https://bugs.python.org/issue43540>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43477] from x import * behavior inconsistent between module types.

2021-03-17 Thread Brett Cannon


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 here was requested by the user", since imports have side-effects, and 
one of those is setting submodules as attributes on packages post-import.

Thanks for the report and all the details, Thomas, but I am still going to 
close this as not a bug.

--
resolution:  -> not a bug
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue43477>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43477] from x import * behavior inconsistent between module types.

2021-03-16 Thread Brett Cannon


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 (or frankly anything that comes after `import`). As part of importing 
`test_pkg.test_submodule`, it automatically gets attached to `test_pkg`, 
otherwise we wouldn't be able to cache the module in `sys.modules` and prevent 
redundant/duplicate imports.

As such, when you do `import test_pkg` in`test.py`, the fact that 
`test_pkg.__init__` has to import `test_pkg.test_submodule` means `test_pkg 
will automatically end up with a `test_submodule` attribute. That's why your 
`print()` function call succeeds.

If I'm still misunderstanding, can you please use an `assert` statement that 
fails because the logic doesn't work the way you expect it to be?

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue43477>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43477] from x import * behavior inconsistent between module types.

2021-03-15 Thread Brett Cannon


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 important to be clear because not all imports come from a file 
system, and so a package versus a module has important distinctions.

Could you write out what you're seeing and what you're expecting? E.g.
```
# pkg/__init__.py
from pkg.submodule import *  # Expecting `submodule_attr`, getting ...
```

```
# pkg/submodule.py
submodule_attr = 0
```

I will also say you really shouldn't be using `import *`. It primarily exists 
to make it easier to work in the REPL, and otherwise is rather archaic and has 
very odd import semantics.

As for how Python 2 did things, that (luckly) doesn't matter anymore. :) To 
show that this is a change in semantics you would need to check Python 3 
versions to see where it shifted. If this changed in 3.9 then turning it back 
may work. But if it's more like 3.4 then I'm afraid these are now the semantics 
and the risk of code breakage is possibly too high.

--

___
Python tracker 
<https://bugs.python.org/issue43477>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43456] Remove _xxsubinterpreters from sys.stdlib_module_names

2021-03-10 Thread Brett Cannon


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/issue43456>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43456] Remove _xxsubinterpreters from sys.stdlib_module_names

2021-03-09 Thread Brett Cannon


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 (Lib)
messages: 388401
nosy: brett.cannon, vstinner
priority: normal
severity: normal
status: open
title: Remove _xxsubinterpreters from sys.stdlib_module_names
type: behavior
versions: Python 3.10

___
Python tracker 
<https://bugs.python.org/issue43456>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14678] Update zipimport to support importlib.invalidate_caches()

2021-03-08 Thread Brett Cannon


Change by Brett Cannon :


--
versions: +Python 3.10 -Python 3.8

___
Python tracker 
<https://bugs.python.org/issue14678>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14678] Update zipimport to support importlib.invalidate_caches()

2021-03-08 Thread Brett Cannon


Change by Brett Cannon :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue14678>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38302] [3.10] __pow__ and __rpow__ are not reached when __ipow__ returns NotImplemented for **=

2021-02-26 Thread Brett Cannon


Change by Brett Cannon :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue38302>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38302] [3.10] __pow__ and __rpow__ are not reached when __ipow__ returns NotImplemented for **=

2021-02-26 Thread Brett Cannon


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


--

___
Python tracker 
<https://bugs.python.org/issue38302>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38302] [3.10] __pow__ and __rpow__ are not reached when __ipow__ returns NotImplemented for **=

2021-02-19 Thread Brett Cannon


Change by Brett Cannon :


--
pull_requests: +23367
pull_request: https://github.com/python/cpython/pull/24587

___
Python tracker 
<https://bugs.python.org/issue38302>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28007] Bad .pyc files prevent import of otherwise valid .py files.

2021-02-19 Thread Brett Cannon


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>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42129] Support resources in namespace packages

2021-02-17 Thread Brett Cannon


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 deprecate this sort of thing.

--

___
Python tracker 
<https://bugs.python.org/issue42129>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38302] [3.10] __pow__ and __rpow__ are not reached when __ipow__ returns NotImplemented for **=

2021-02-01 Thread Brett Cannon


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/issue38302>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43037] Importlib reload by module name (String)

2021-01-27 Thread Brett Cannon


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 a string because the module might not even exist yet.

And as Serhiy said, reloading is a bit dangerous and shouldn't be taken 
lightly. It primarily exists to reload a module when you're working in the REPL 
and editing a file live, not for anything fancy during execution of production 
code. So keeping it squarely targeted the REPL case and making it a bit harder 
for other cases is a good thing in my opinion.

--
resolution:  -> rejected
stage:  -> resolved
status: open -> closed
versions: +Python 3.10 -Python 3.9

___
Python tracker 
<https://bugs.python.org/issue43037>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42811] Update docs for importlib.util.resolve_name() to use __spec__.parent instead of __package__

2021-01-07 Thread Brett Cannon


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/ca8e96d1edbeb536f58da91e607082463398fce1


--

___
Python tracker 
<https://bugs.python.org/issue42811>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42839] SourceFileLoader does not (fully) accept path-like objects

2021-01-06 Thread Brett Cannon

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 trying to marshal a code object for the 
eventual .pyc file and failing 
(https://github.com/python/cpython/blob/faf49573963921033c608b4d2f398309d9f0d2b5/Lib/importlib/_bootstrap_external.py#L604).
 The real question is why is any unmarshallable object getting passed in the 
first place since that object is the code object that compile() returned.

Best guess? The compile() function is being given the path-like object (via 
https://github.com/python/cpython/blob/faf49573963921033c608b4d2f398309d9f0d2b5/Lib/importlib/_bootstrap_external.py#L848)
 and it's blindly setting it on the code object itself, and then marhsal fails 
since it can't handle pathlib.Path. If my hunch is right, then the possible 
solutions are:

- Don't do that 
- Make compile() aware of path-like objects
- Have importlib explicitly work around compile()'s shortcoming by doing the 
right thing for path-like objects before passing in the the 'path' argument.

--

___
Python tracker 
<https://bugs.python.org/issue42839>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42811] Update docs for importlib.util.resolve_name() to use __spec__.parent instead of __package__

2021-01-06 Thread Brett Cannon


Change by Brett Cannon :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue42811>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42811] Update docs for importlib.util.resolve_name() to use __spec__.parent instead of __package__

2021-01-05 Thread Brett Cannon


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 
<https://bugs.python.org/issue42811>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17343] Add a version of str.split which returns an iterator

2021-01-04 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 
<https://bugs.python.org/issue17343>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29708] support reproducible Python builds

2021-01-04 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 
<https://bugs.python.org/issue29708>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40059] Provide a toml module in the standard library

2021-01-02 Thread Brett Cannon


Change by Brett Cannon :


--
versions:  -Python 3.10, Python 3.9

___
Python tracker 
<https://bugs.python.org/issue40059>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42811] Update docs for importlib.util.resolve_name() to use __spec__ instead of __package__

2021-01-02 Thread Brett Cannon


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: Documentation
keywords: easy
messages: 384238
nosy: brett.cannon
priority: low
severity: normal
stage: needs patch
status: open
title: Update docs for importlib.util.resolve_name() to use __spec__ instead of 
__package__
versions: Python 3.10

___
Python tracker 
<https://bugs.python.org/issue42811>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42667] shelve module is not thread-safe during accessing different databases from different threads

2020-12-17 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 
<https://bugs.python.org/issue42667>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39041] Support GitHub Actions in CI

2020-12-16 Thread Brett Cannon


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/issue39041>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42125] linecache cannot get source for the __main__ module with a custom loader

2020-12-16 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 
<https://bugs.python.org/issue42125>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26131] Raise ImportWarning when loader.load_module() is used

2020-12-09 Thread Brett Cannon


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 exec_module().

--

___
Python tracker 
<https://bugs.python.org/issue26131>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42564] "from .__init__ import ..." syntax imports a duplicate module

2020-12-07 Thread Brett Cannon


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/issue42564>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   3   4   5   6   7   8   9   10   >