[issue45427] importlib.readers.MultiplexedPath

2021-10-17 Thread David Rajaratnam


David Rajaratnam  added the comment:

I'm closing the bug report. Clearly not a bug. It looks like 
importlib.resources.as_file() is exactly what I want. It returns a context and 
can potentially create a temporary file system directory structure with all 
files I want underneath. Not sure how I missed this before and was struggling 
to work out what to do with a MultiplexedPath object.

If you do have comments on a better way of separating python and non-python 
code (see my previous use-case explanation) I'm interested to hear it.

Regards,
Dave

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

___
Python tracker 

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



[issue45505] Remove unneeded ZipFile IO

2021-10-17 Thread Jan Wolski


New submission from Jan Wolski :

Currently in the ZipFile class implementation, when processing the zip file 
headers "extra" field, a .read() call is used without using the returned value 
in any way. This call could be replaced with a .seek() to avoid actually doing 
the IO.

The change would improve performance in use cases where the fileobject given to 
ZipFile is backed by high latency IO, eg. HTTP range requests.

--
components: Library (Lib)
messages: 404155
nosy: data-ux
priority: normal
pull_requests: 27292
severity: normal
status: open
title: Remove unneeded ZipFile IO
type: performance

___
Python tracker 

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



[issue45427] importlib.readers.MultiplexedPath

2021-10-17 Thread David Rajaratnam


David Rajaratnam  added the comment:

Hi Filipe,

Thanks very much for the pointers and for the clarifications. I'll look at 
using importlib.resources.as_file(). I think this is the API that I stupidly 
seemed to have missed!

However, it is also very possible that I am misunderstanding the correct usage 
of the importlib.resource library, so here is a summary of my use-case:

I am working with a specialised language interpreter that can be embedded in 
python. The interpreter API requires a file system path to load files and the 
language itself has its own "include" statements for loading files. So in my 
case it has to be a file system path and not some other resource (eg. zip file 
or database).

However, I have struggled to understand what is the correct way to treat these 
files when installed as part of a python package. It seems to me that python's 
setuptools is too limited to cover the range of options that I would want. 
AFAIK setuptools allows only two options for installing non-python files; 
"data_files" and "package_data". "data_files" doesn't seem to be the right 
place because I couldn't find a full-proof way to programmatically find out 
where these files are installed. So it seems to be focused more on 
supplementary data (high-level docs, examples, etc) rather than data files that 
are necessary for the operations of the application.

On the other hand "package_data" forces these non-python files to be embedded 
within the python package structure. This is a bit ugly since its not really a 
natural fit; for example the language has its own command-line tools that I use 
during development.

So what I've tried to do is that for development I separate the python code 
from my other interpreter's code, but then for installation have setup.py map 
the specialised language files into the python package structure. I'm not 
overly happy with how I've done it (although it does seem to work),so I would 
be very happy if someone can point to a better way.

Dave

--

___
Python tracker 

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



[issue43805] multiprocessing.Queue hangs when process on other side dies

2021-10-17 Thread Myles Steinhauser


Change by Myles Steinhauser :


--
nosy: +myles.steinhauser

___
Python tracker 

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



[issue22393] multiprocessing.Pool shouldn't hang forever if a worker process dies unexpectedly

2021-10-17 Thread Myles Steinhauser


Change by Myles Steinhauser :


--
nosy: +myles.steinhauser

___
Python tracker 

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



[issue34781] infinite waiting in multiprocessing.Pool

2021-10-17 Thread Myles Steinhauser


Change by Myles Steinhauser :


--
nosy: +myles.steinhauser

___
Python tracker 

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



[issue45504] [argparse] Entering a partial config_parser flag works with subparsers

2021-10-17 Thread Steven W


Change by Steven W :


--
components: +Library (Lib) -Parser

___
Python tracker 

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



[issue45504] [argparse] Entering a partial config_parser flag works with subparsers

2021-10-17 Thread Steven


New submission from Steven :

I have a package with a module called `commands.py`. This file is basically 
three sub parsers and an entry point. 

Here is one of my subparsers. It shows the current path of a config file, and 
lets you update the path if you want.

#config sub-command
config_parser = subparsers.add_parser('config')
config_parser.set_defaults(func=config_path)
config_parser.add_argument('--show', help='show current config file path - 
takes no input', action='store_true')
config_parser.add_argument('--update', help='modify config file path', 
dest='path')

If you look at the first config_parser which is `--show`. Notice how it doesn't 
take an input. You just pass in --show and it prints the config path to the cli.

Here is the function that tells --show what to do.;

def config_path(args):
dotenv_file = dotenv.find_dotenv()
dotenv.load_dotenv(dotenv_file)
if args.show:
print(os.environ['FILE_PATH']) 
elif args.path:
os.environ['FILE_PATH'] = args.path
dotenv.set_key(dotenv_file, 'FILE_PATH', os.environ['FILE_PATH'])

This is what my entrypoints in my setup.py looks like.

entry_points={
'console_scripts': [
#command = package.module:function
'conftool = conftool.commands:main',
],
}
)

All of the following work

conftool config --s
conftool config --sh
conftool config --sho
conftool config --show

I have another sub parser and function like the one above. The config_parser is 
basically the same. It has an option that doesn't take an argument and store is 
true. They behave the same way. The other function and subparser have an option 
that is `--gettoken`. It works with --g, --ge, --get, --gett, --getto, 
--gettok, gettoke.

Is this possibly a bug?

--
components: Parser
messages: 404153
nosy: lys.nikolaou, pablogsal, swills1
priority: normal
severity: normal
status: open
title: [argparse] Entering a partial config_parser flag works with subparsers
versions: Python 3.9

___
Python tracker 

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



[issue30570] issubclass segfaults on objects with weird __getattr__

2021-10-17 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
keywords: +patch
pull_requests: +27291
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29017

___
Python tracker 

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



[issue45475] gzip fails to read a gzipped file (ValueError: readline of closed file)

2021-10-17 Thread Inada Naoki


Change by Inada Naoki :


--
keywords: +patch
pull_requests: +27290
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29016

___
Python tracker 

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



[issue30570] issubclass segfaults on objects with weird __getattr__

2021-10-17 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Python metaprogramming allows type-like things to be bases, not just things 
that pass PyType_Check().  so being that strict isn't going to work.

The other classic way to prevent this is to track what you're recursing on to 
avoid a loop.  i.e. Keeping a set of PyObjects that have been seen and not 
recursing if the value is in that.

--

___
Python tracker 

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



[issue30570] issubclass segfaults on objects with weird __getattr__

2021-10-17 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
assignee:  -> gregory.p.smith

___
Python tracker 

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



[issue30570] issubclass segfaults on objects with weird __getattr__

2021-10-17 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

This is a stack overflow in Objects/abstract.c because we infinitely recurse 
within abstract_issubclass().

We should probably do some validity checking on the bases tuple that 
abstract_get_bases returns (ideally within abstract_get_bases?).  The tuple 
must contain types.

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue39423] Process finished with exit code -1073741819 (0xC0000005) when trying to access data from a pickled file

2021-10-17 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

As your problem involves numpy and PyQt, both of which are very complicated 
third party extension module code, chances are there is a bug within those that 
is leading to memory corruption.

--
nosy: +gregory.p.smith
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue39419] Core dump when trying to use workaround for custom warning category (Fatal Python error: init_sys_streams: can't initialize sys standard streams)

2021-10-17 Thread Irit Katriel


Irit Katriel  added the comment:

Can you reproduce this on 3.10 or 3.11?

OpenWrapper is deprecated and no longer defined in the io module from 3.10.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue45367] Specialize BINARY_MULTIPLY

2021-10-17 Thread Dennis Sweeney


Change by Dennis Sweeney :


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

___
Python tracker 

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



[issue37013] Fatal Python error in socket.if_indextoname()

2021-10-17 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7, Python 3.8

___
Python tracker 

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



[issue30774] list_repr not safe against concurrent mutation

2021-10-17 Thread Irit Katriel


Irit Katriel  added the comment:

Reproduced on 3.11.

--
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, Python 
3.6, Python 3.7

___
Python tracker 

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



[issue39679] functools: singledispatchmethod doesn't work with classmethod

2021-10-17 Thread Alex Waygood


Alex Waygood  added the comment:

Happily, this bug appears to have been resolved in Python 3.10 due to the fact 
that a `classmethod` wrapping a function `F` will now have an `__annotations__` 
dict equal to `F`.

In Python 3.9:

```
>>> x = lambda y: y
>>> x.__annotations__ = {'y': int}
>>> c = classmethod(x)
>>> c.__annotations__
Traceback (most recent call last):
  File "", line 1, in 
c.__annotations__
AttributeError: 'classmethod' object has no attribute '__annotations__'
```

In Python 3.10:

```
x = lambda y: y
x.__annotations__ = {'y': int}
c = classmethod(x)
c.__annotations__
{'y': }
```

This change appears to have resolved the bug in 
`functools.singledispatchmethod`. The bug remains in Python 3.9, however.

--
nosy: +AlexWaygood
versions:  -Python 3.8

___
Python tracker 

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



[issue32584] Uninitialized free_extra in code_dealloc

2021-10-17 Thread Irit Katriel


Irit Katriel  added the comment:

Is there anything left to do on this issue? It seems like a question more than 
a bug report.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue32291] Value error for string shared memory in multiprocessing

2021-10-17 Thread Irit Katriel


Irit Katriel  added the comment:

Is there anything left to do here?

It seems hongweipeng's explanation and the link to the documentation pretty 
much cover it.

--
nosy: +iritkatriel
resolution:  -> not a bug
status: open -> pending

___
Python tracker 

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



[issue30528] ipaddress.IPv{4,6}Network.reverse_pointer is broken

2021-10-17 Thread Foster Snowhill


Foster Snowhill  added the comment:

I've stumbled upon this myself, and had a go at fixing it, before looking up 
this issue. My approach ended up being a bit different:

1. I rewrote the existing _reverse_pointer() methods, so that they'd handle 
both addresses and networks, instead of defining separate methods for the 
IPvXNetwork classes.
2. Trying to generate a reverse pointer for a prefix that doesn't align with 
the granularity of reverse pointers (8 bits for IPv4, 4 bits for IPv6) will 
raise an exception instead of returning a more general prefix.

I would like to bring up point 2 for discussion, since it differs from both of 
the other PRs submitted regarding this issue.

For example, let's take an example subnet 127.45.240.0/20. The other solutions 
here propose generating a reverse pointer like "45.127.in-addr.arpa", i.e. 
returning a reverse pointer to a bigger subnet that includes the original one. 
When you convert that reverse pointer back into a network, you get 
127.45.0.0/16. It doesn't match the original network, thus you lose some 
information about it.

I'd like to propose to be more strict about it (or at least, make the strict 
behaviour an option) to avoid unintentional loss of precision when generating 
reverse pointers in these cases.

--

___
Python tracker 

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



[issue30528] ipaddress.IPv{4,6}Network.reverse_pointer is broken

2021-10-17 Thread Foster Snowhill


Change by Foster Snowhill :


--
pull_requests: +27289
pull_request: https://github.com/python/cpython/pull/29011

___
Python tracker 

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



[issue45229] Always use unittest for collecting tests in regrtests

2021-10-17 Thread miss-islington


miss-islington  added the comment:


New changeset 65c1db794e0484e18142658c691141387c1dc2e4 by Miss Islington (bot) 
in branch '3.10':
bpo-45229: Make test_http_cookiejar discoverable (GH-29004)
https://github.com/python/cpython/commit/65c1db794e0484e18142658c691141387c1dc2e4


--

___
Python tracker 

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



[issue45229] Always use unittest for collecting tests in regrtests

2021-10-17 Thread miss-islington


miss-islington  added the comment:


New changeset 1dbf9c86b25463b9bc695e434ac034a7e313ba01 by Miss Islington (bot) 
in branch '3.9':
bpo-45229: Make test_http_cookiejar discoverable (GH-29004)
https://github.com/python/cpython/commit/1dbf9c86b25463b9bc695e434ac034a7e313ba01


--

___
Python tracker 

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



[issue31419] Can not install python3.6.2 due to Error 0x80070643: Failed to install MSI package

2021-10-17 Thread Irit Katriel


Irit Katriel  added the comment:

Please create a new issue if this is still a problem on 3.9 or above.

--
resolution:  -> out of date
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue45478] Send a patch to libexpat to solve _POSIX_C_SOURCE issue.

2021-10-17 Thread Dong-hee Na


Dong-hee Na  added the comment:

https://github.com/libexpat/libexpat/pull/514

merged, The change is affected to libexpat 2.4.2

--

___
Python tracker 

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



[issue45192] The tempfile._infer_return_type function cannot infer the type of os.PathLike objects.

2021-10-17 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

This is a duplicate of #29447, so if this is merged, the other issue should 
also be closed as fixed.

--
nosy: +andrei.avk

___
Python tracker 

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



[issue45477] configure script cannot detect float word ordering on linux

2021-10-17 Thread Sourish Basu


Sourish Basu  added the comment:

I executed:

$ icc -c -O3 -fPIC -fp-model strict -fp-model source -axCORE-AVX512,CORE-AVX2 
-xAVX -ipo -prec-div -prec-sqrt conftest.c

and conftest.o was built without errors. It has one symbol, as expected:

$ nm conftest.o
 U __must_be_linked_with_icc_or_xild
 D d

--

___
Python tracker 

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



[issue45229] Always use unittest for collecting tests in regrtests

2021-10-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27288
pull_request: https://github.com/python/cpython/pull/29007

___
Python tracker 

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



[issue45229] Always use unittest for collecting tests in regrtests

2021-10-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset b3f0ceae919c1627094ff628c87184684a5cedd6 by Serhiy Storchaka in 
branch 'main':
bpo-45229: Make test_http_cookiejar discoverable (GH-29004)
https://github.com/python/cpython/commit/b3f0ceae919c1627094ff628c87184684a5cedd6


--

___
Python tracker 

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



[issue45229] Always use unittest for collecting tests in regrtests

2021-10-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27287
pull_request: https://github.com/python/cpython/pull/29006

___
Python tracker 

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



[issue45503] Several improvement point of gdbm module

2021-10-17 Thread Dong-hee Na


Change by Dong-hee Na :


--
components: +Library (Lib)
type:  -> enhancement
versions: +Python 3.11

___
Python tracker 

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



[issue45503] Several improvement point of gdbm module

2021-10-17 Thread Dong-hee Na


New submission from Dong-hee Na :

I have a chance to exchange mail with gdbm module maintainer Sergey Poznyakoff 
to supporting the crash tolerance feature.
(See bpo-45452) 

Other dbm modules also might have the same issue what the maintainer pointed 
out.

I copy and paste the content that gdbm maintainer's pointed out.

I would like to listen to other core dev's opinions about the gdbm moudle and 
also other dbm module interface improvements.
I add the core devs who might have an interest in this issue.

Personally, I have interests in Error handling and items() and values() methods 
issues.


1. Error handling

The most problematic place.  Most methods throw an error in case of
failure, which is quite OK.  However, to do so they use PyErr_SetString
and PyErr_SetFromErrno family functions, passing the gdbm_errno value
as their argument.  This is plain wrong.  These functions treat the
errno argument as a value of C "errno" variable.  Obviously, gdbm_errno
codes have diffeent meanings, so the resulting diagnostics is misleading
if not downright unusable.

2. Lack of interfaces for database export/import (gdbm_dump and
gdbm_load functions).  This is quite an important aspect, in particular
for handling database backups.

3. Lack of interface for database recovery (gdbm_recover function).

4. The items() and values() methods are not supported.  These should be
easy to implement using gdbm_firstkey/gdbm_nextkey.

--
messages: 404136
nosy: corona10, methane, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Several improvement point of gdbm module

___
Python tracker 

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



[issue45477] configure script cannot detect float word ordering on linux

2021-10-17 Thread Christian Heimes


Christian Heimes  added the comment:

Please build conftest.o with compiler flags 

icc -c -O3 -fPIC -fp-model strict -fp-model source -axCORE-AVX512,CORE-AVX2 
-xAVX -ipo -prec-div -prec-sqrt 

and attach the file.

--

___
Python tracker 

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



[issue45229] Always use unittest for collecting tests in regrtests

2021-10-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +27286
pull_request: https://github.com/python/cpython/pull/29004

___
Python tracker 

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



[issue45229] Always use unittest for collecting tests in regrtests

2021-10-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
dependencies: +Rewrite test_dbm

___
Python tracker 

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



[issue45229] Always use unittest for collecting tests in regrtests

2021-10-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
dependencies: +Fix test_shelve and make it discoverable

___
Python tracker 

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



[issue45502] Fix test_shelve and make it discoverable

2021-10-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +27285
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29003

___
Python tracker 

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



[issue45502] Fix test_shelve and make it discoverable

2021-10-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Also it was only tested with pickle protocols 0, 1 and 2. Now it will be tested 
with all pickle protocols.

--

___
Python tracker 

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



[issue45502] Fix test_shelve and make it discoverable

2021-10-17 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

test_shelve was intended to run some tests for all underlying dbm 
implementation, but since b17acad68ea21c60dbc2088644f2934032304628 (at May 
2008) it runs them with the same implementation.

The proposed PR fixes this regression and also makes test_shelve discoverable, 
so it can be run with the unittest module.

--
components: Tests
messages: 404133
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Fix test_shelve and make it discoverable
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue45501] [idea] Successfully creating a venv could print a message.

2021-10-17 Thread Julien Palard

New submission from Julien Palard :

I realized that many students get surprised by `python -m venv .venv` not 
printing anything, a few even think it completly failed.

I'm OK teaching them this is normal, as `mv`, `cp`, `rm`, `django-admin 
startproject`, ... does not print neither when they succeed.

But I fear many other Python users could be surprised too and not have a 
teacher around to reassure them.

I kept this as a status-quo for years but thinking of it today I though « And 
why not telling them how to activate the venv? »

Would'nt it be great to have:

$ python3 -m venv .venv
Environment created successfully, activate it using:

source .venv/bin/activate

or

PS C:\Users\Admin> python3 -m venv .venv
Environment created successfully, activate it using:

.venv\Scripts\Activate.ps1

and so on?

A `-q`/`--quiet` could be added for scripts creating venvs.

--
messages: 404132
nosy: mdk
priority: normal
severity: normal
status: open
title: [idea] Successfully creating a venv could print a message.

___
Python tracker 

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



[issue45500] Rewrite test_dbm

2021-10-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +27284
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29002

___
Python tracker 

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



[issue45500] Rewrite test_dbm

2021-10-17 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

* Generate test classes at import time. It allows to filter them when run with 
unittest. E.g: "./python -m unittest test.test_dbm.TestCase_gnu -v".
* Create a database class in a new directory which will be removed after test. 
It guarantees that all created files and directories be removed and will not 
conflict with other dbm tests.
* Restore dbm._defaultmod after tests. Previously it was set to the last dbm 
module (dbm.dumb) which affected other tests.
* Enable the whichdb test for dbm.dumb.
* Move test_keys to the correct test class. It does not test whichdb().
* Remove some outdated code and comments.

--
components: Tests
messages: 404131
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Rewrite test_dbm
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.11

2021-10-17 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +AlexWaygood

___
Python tracker 

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



[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.11

2021-10-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I think it would help if we could enable some future feature globally by 
command line option or environment variable, without modifying all source 
files. It would allow users to quickly test their code base for compatibility 
with future changes. The problem currently is that nobody bothers to add "from 
__future__ import ...", so we have surprises every time when try to make it by 
default.

A tool which automatically adds or removes "from __future__ import ..." in 
files could help too.

--

___
Python tracker 

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