[issue32133] documentation: numbers module nitpick

2021-05-15 Thread Miguel Brito


Change by Miguel Brito :


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

___
Python tracker 

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



[issue32133] documentation: numbers module nitpick

2021-05-15 Thread Miguel Brito


Miguel Brito  added the comment:

@rhettinger added your suggestion.

--

___
Python tracker 

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



[issue44136] Remove pathlib flavours

2021-05-15 Thread Barney Gale


Change by Barney Gale :


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

___
Python tracker 

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



[issue32133] documentation: numbers module nitpick

2021-05-15 Thread Sergey B Kirpichev


Sergey B Kirpichev  added the comment:

Maybe some methods from the Complex class could be moved to the Number class?

I think, that something like the ring structure (probably even a commutative 
ring) is expected from the number classes in the Python.  I.e. there should be 
__add__/__sub__/__mul__/__pos__/__neg__/__pow__/etc.  But not 
__truediv__/__floordiv__.

Even simpler idea: move the __eq__ method to the Number class.

Then it would be impossible to instantiate a Number.

--

___
Python tracker 

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



[issue44140] WeakKeyDictionary should support lookup by id instead of hash

2021-05-15 Thread conchylicultor


New submission from conchylicultor :

WeakKeyDictionary are great to "associate additional data with an object owned 
by other parts of an application", as quoted from the doc: 
https://docs.python.org/3/library/weakref.html#weakref.WeakKeyDictionary

However, this currently only works for hashable types. Non-hashables are not 
supported:

```
@dataclass
class A:
  pass

a = A()

d = weakref.WeakKeyDictionary()
d[a] = 3  # TypeError: unhashable type: 'A'
```

With regular dict, this could be easilly solved by using `d[id(a)] = 3`, but 
WeakKeyDictionary don't accept `int` of course. I cannot wrap the object either 
as the weakref would not be attached to the original object, but the wrapper.

It would be great to be able to force WeakKeyDictionary to perform lookup on 
`id` internally. Like `d = WeakKeyDictionary(use_id_lookup=True)`

--
components: Library (Lib)
messages: 393707
nosy: conchylicultor
priority: normal
severity: normal
status: open
title: WeakKeyDictionary should support lookup by id instead of hash
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 

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



[issue44137] importlib.resources.path raises RuntimeError when FileNotFoundError is raise in context manager

2021-05-15 Thread Miguel Brito


Miguel Brito  added the comment:

I can reproduce this. From what I can see the issue is that 
`importlib.resources.path` intentionally suppresses `FileNotFoundError` errors.

https://github.com/python/cpython/blob/main/Lib/importlib/resources.py#L138

Based on `importlib.resources.path` docstring I think this is to avoid raising 
an exception if the file is deleted before the context manager exits.

On contextlib.py, since type is not None, it will try to throw the exception 
but since it's supressed nothing will happen and the code will reach the end by 
raising the RuntimeError.

https://github.com/python/cpython/blob/main/Lib/contextlib.py#L151

If I'm not mistaken, this is the test that verifies that behaviour: 
https://github.com/python/cpython/blob/main/Lib/test/test_importlib/test_path.py#L51


I'm not a core dev but it looks like it's an intentional behaviour.

Maybe the docs should be more clear about this. It's not obvious to me when I 
read the docs.

--
nosy: +miguendes

___
Python tracker 

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-05-15 Thread Antoine Pitrou


Change by Antoine Pitrou :


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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-05-15 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
pull_requests: +24777
pull_request: https://github.com/python/cpython/pull/26142

___
Python tracker 

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-05-15 Thread miss-islington


miss-islington  added the comment:


New changeset 71dca6ea73aaf215fafa094512e8c748248c16b0 by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-37788: Fix reference leak when Thread is never joined (GH-26103) 
(GH-26138)
https://github.com/python/cpython/commit/71dca6ea73aaf215fafa094512e8c748248c16b0


--

___
Python tracker 

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



[issue43504] Site linked in docs, effbot.org, down

2021-05-15 Thread Julien Palard


Change by Julien Palard :


--
keywords: +easy, newcomer friendly

___
Python tracker 

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-05-15 Thread miss-islington


miss-islington  added the comment:


New changeset b30b25b26663fb6070b8ed86fe3a20dcb557d05d by Antoine Pitrou in 
branch '3.9':
[3.9] bpo-37788: Fix reference leak when Thread is never joined (GH-26103) 
(GH-26142)
https://github.com/python/cpython/commit/b30b25b26663fb6070b8ed86fe3a20dcb557d05d


--

___
Python tracker 

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-05-15 Thread Antoine Pitrou


Change by Antoine Pitrou :


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



[issue44141] Getting error while importing ssl "import _ssl ImportError: DLL load failed: The specified procedure could not be found."

2021-05-15 Thread Tarnum


New submission from Tarnum :

Hello! I'm using specifically crafted Python 3.7.1 for NT 5.2 x86 (Server 2003 
R2) and cannot upgrade Python to later versions.
I always building OpenSSL myself using compatible version of MSYS2 with perl 
5.22.
Compiled DLLs of OpenSSL 1.1.1k works fine for me (libcrypto-1_1.dll and 
libssl-1_1.dll in C:\Python37\DLLs\).
But when I try building OpenSSL 3.0.0 alpha 16 (repacing libcrypto-3.dll with 
libcrypto-1_1.dll and libssl-3.dll with libssl-1_1.dll in
Makefile and util\mkdef.pl) I got this error because of OpenSSL 3.0 backwards 
incompatibility:

import ssl
File "C:\Python37\lib\ssl.py", line 98, in 
import _ssl (C:\Python37\DLLs\_ssl.pyd) # if we can't import it, let the error 
propagate
ImportError: DLL load failed: The specified procedure could not be found.

What could I do to fix it? Thanks in advance!

--
assignee: christian.heimes
components: SSL, Windows
messages: 393711
nosy: Tarnum, christian.heimes, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Getting error while importing ssl "import _ssl ImportError: DLL load 
failed: The specified procedure could not be found."
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue24132] Direct sub-classing of pathlib.Path

2021-05-15 Thread Barney Gale


Change by Barney Gale :


--
pull_requests: +24778
pull_request: https://github.com/python/cpython/pull/26141

___
Python tracker 

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



[issue44135] issubclass documentation doesn't explain tuple semantic

2021-05-15 Thread Ken Jin


Ken Jin  added the comment:

I agree that this subtlety could be expressed better. Thanks for the catch! 
Would you like to work on this?

BTW, only Python 3.9 and higher are still receiving bugfixes (including doc 
fixes). The older versions are either security fixes only or end of life :).

--
keywords: +easy, newcomer friendly
nosy: +kj
versions:  -Python 3.6, 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



[issue13498] os.makedirs exist_ok documentation is incorrect, as is some of the behavior

2021-05-15 Thread Bonifacio

Bonifacio  added the comment:

I just read this issue's history and it looks like it is out of date. The docs 
now match the behaviour.

> If the file exists but the mode is different than that specified (or 
> defaulted) after applying the umask, then an error is raised regardless of 
> the value of exist_ok.

This isn’t true anymore.

> The above wording also implies that if the directory exists but has a 
> different mode, that the mode will be changed.  Again, this is not what the 
> code does.

The docs now state the behaviour explicitly: “The file permission bits of 
existing parent directories are not changed.”

This means the reported issue no longer exists. But somewhere along the 
discussion it became one about adding a new flag to control the behaviour when 
there are mode mismatches. I tried applying Hynek’s patch locally, but it 
doesn’t work anymore. If we want to go ahead with adding this new flag we would 
have to create a new patch. If we want to drop the change then this issue can 
be closed.

If we decide to go with the flag addition I’m glad to help fixing Hynek’s 
patch’s incompatibilities if he is ok with that.

--
nosy: +Bonifacio2

___
Python tracker 

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



[issue44081] ast.unparse: dont use redundant space separator for lambdas with no parameters

2021-05-15 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


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



[issue38768] [feature request] Add lldb equivalent to Tools/gdb

2021-05-15 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
nosy: +erlendaasland

___
Python tracker 

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



[issue44142] ast.unparse: visually better code generation

2021-05-15 Thread Batuhan Taskaya


New submission from Batuhan Taskaya :

This issue is for tracking possible places where we could generate better code 
on ast.unparse (better as in more closely to what people are actually writing 
than our naive implementation). 

Examples;
>>> import ast
>>> ast.unparse(ast.parse('a, b, c = [1,2,3]'))
'(a, b, c) = [1, 2, 3]'

could be
>>> ast.unparse(ast.parse('a, b, c = [1,2,3]'))
'a, b, c = [1, 2, 3]'

OR
>>> print(ast.unparse(ast.parse('if value := d.get("something"): 
>>> print(value)')))
if (value := d.get('something')):
print(value)

could be
>>> print(ast.unparse(ast.parse('if value := d.get("something"): 
>>> print(value)')))
if value := d.get('something'):
print(value)

We could even go further with the long line unpacking (which would definitely 
require some sort of clever algorithm for nested structures). 

>>> source = '[\n' + '\tsomething,\n' * 20 + ']'
>>> print(source)
[
something,
something,
something,
something,
something,
something,
something,
something,
something,
something,
something,
something,
something,
something,
something,
something,
something,
something,
something,
something,
]
>>> print(ast.unparse(ast.parse(source)))
[something, something, something, something, something, something, something, 
something, something, something, something, something, something, something, 
something, something, something, something, something, something]

--
assignee: BTaskaya
components: Library (Lib)
messages: 393714
nosy: BTaskaya, pablogsal
priority: normal
severity: normal
status: open
title: ast.unparse: visually better code generation
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



[issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module

2021-05-15 Thread Ma Lin


Change by Ma Lin :


--
pull_requests: +24779
pull_request: https://github.com/python/cpython/pull/26143

___
Python tracker 

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



[issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module

2021-05-15 Thread Ma Lin


Ma Lin  added the comment:

Sorry, for the (init_size > UINT32_MAX) problem, I have a better solution.

Please imagine this scenario:
- before the patch
- in 64-bit build
- use zlib.decompress() function
- the exact decompressed size is known and > UINT32_MAX (e.g. 10 GiB)

If set the `bufsize` argument to the decompressed size, it used to have a fast 
path:

zlib.decompress(data, bufsize=10*1024*1024*1024)

Fast path when (the initial size == the actual size):
https://github.com/python/cpython/blob/v3.9.5/Modules/zlibmodule.c#L424-L426

https://github.com/python/cpython/blob/v3.9.5/Objects/bytesobject.c#L3008-L3011

But in the current code, the initial size is clamped to UINT32_MAX, so there 
are two regressions:

1. allocate double RAM. (~20 GiB, blocks and the final bytes)
2. need to memcpy from blocks to the final bytes.

PR 26143 uses an UINT32_MAX sliding window for the first block, now the initial 
buffer size can be greater than UINT32_MAX.

_BlocksOutputBuffer_Finish() already has a fast path for single block. 
Benchmark this code:

zlib.decompress(data, bufsize=10*1024*1024*1024)

  time  RAM
before: 7.92 sec, ~20 GiB
after:  6.61 sec,  10 GiB
(AMD 3600X, DDR4-3200, decompressed data is 10_GiB * b'a')

Maybe some user code rely on this corner case.
This should be the last revision, then there is no regression in any case.

--

___
Python tracker 

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



[issue43650] MemoryError on zip.read in shutil._unpack_zipfile

2021-05-15 Thread Ma Lin


Change by Ma Lin :


--
nosy: +malin

___
Python tracker 

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



[issue44134] lzma: stream padding in xz files

2021-05-15 Thread Ma Lin


Change by Ma Lin :


--
nosy: +malin

___
Python tracker 

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



[issue44139] Unparenthesized tuple doc bug in what's new

2021-05-15 Thread Ned Deily


Change by Ned Deily :


--
nosy: +pablogsal

___
Python tracker 

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



[issue44143] The parse crashes when raising tokenizer errors when an existing exception is set

2021-05-15 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

The parser currently crashes when raising exceptions when the error indicator 
set. Reproducer:

import ast
source = """\
[interesting
foo()
"""
print(repr(source))
compile(source, "", "exec")

We need to make sure to clean any existing exception before we raise or own.

--
messages: 393716
nosy: BTaskaya, pablogsal
priority: normal
severity: normal
status: open
title: The parse crashes when raising tokenizer errors when an existing 
exception is set

___
Python tracker 

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



[issue44143] The parse crashes when raising tokenizer errors when an existing exception is set

2021-05-15 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue44139] Unparenthesized tuple doc bug in what's new

2021-05-15 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue44139] Unparenthesized tuple doc bug in what's new

2021-05-15 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Great idea, I have opened a PR to change it

--
stage: patch review -> 

___
Python tracker 

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



[issue44139] Unparenthesized tuple doc bug in what's new

2021-05-15 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +24782
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26146

___
Python tracker 

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



[issue44132] Local import conflict with system import

2021-05-15 Thread Ned Deily


Ned Deily  added the comment:

Python is behaving as documented here. The problem is that you have a package 
named 'xml' which conflicts with the package of the same name in the standard 
library (https://docs.python.org/3/library/xml.html) which may cause conflicts 
for other packages depending on the import search order. The documentation for 
sys.path (https://docs.python.org/3/library/sys.html#sys.path) explains what 
you are seeing:

'As initialized upon program startup, the first item of this list, path[0], is 
the directory containing the script that was used to invoke the Python 
interpreter. If the script directory is not available (e.g. if the interpreter 
is invoked interactively or if the script is read from standard input), path[0] 
is the empty string, which directs Python to search modules in the current 
directory first. Notice that the script directory is inserted before the 
entries inserted as a result of PYTHONPATH."

So, in your first example, "testdriver" will be the first entry on sys.path 
because the script was invoked from there; this mean 'xml' will be imported 
from the "testdriver" directory. But, in your second example, the script is 
read from the command line via the -c argument so the first sys.path entry will 
be '' and the current directory is 'python_bug' so now your 'xml' package is no 
longer found first.

This is a common pitfall and is sometimes called the "name shadowing trap" (see 
http://python-notes.curiousefficiency.org/en/latest/python_concepts/import_traps.html#the-name-shadowing-trap).
  The easiest and most robust solution is to avoid using package and module 
names that conflict with those in the standard library.

--
nosy: +ned.deily
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



[issue32133] documentation: numbers module nitpick

2021-05-15 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +24783
pull_request: https://github.com/python/cpython/pull/26147

___
Python tracker 

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



[issue44139] Unparenthesized tuple doc bug in what's new

2021-05-15 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 67729a91a5fe6ad06fb5f2cc4f91ad99876e431a by Miss Islington (bot) 
in branch '3.10':
bpo-44139: Use a more descriptive syntax error comprehension case in the What's 
New for 3.10 (GH-26145) (GH-26146)
https://github.com/python/cpython/commit/67729a91a5fe6ad06fb5f2cc4f91ad99876e431a


--

___
Python tracker 

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



[issue44143] The parse crashes when raising tokenizer errors when an existing exception is set

2021-05-15 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +24784
pull_request: https://github.com/python/cpython/pull/26148

___
Python tracker 

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



[issue44139] Unparenthesized tuple doc bug in what's new

2021-05-15 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue32133] documentation: numbers module nitpick

2021-05-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24785
pull_request: https://github.com/python/cpython/pull/26149

___
Python tracker 

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



[issue32133] documentation: numbers module nitpick

2021-05-15 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 376740110ecb2440fee9e04f325131aaefeb5c47 by Miss Islington (bot) 
in branch '3.9':
bpo-32133: Improve numbers docs (GH-26124) (GH-26147)
https://github.com/python/cpython/commit/376740110ecb2440fee9e04f325131aaefeb5c47


--

___
Python tracker 

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



[issue32133] documentation: numbers module nitpick

2021-05-15 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset a38db84122b4f664ee30b9ffd55ce87b7f4517ac by Miss Islington (bot) 
in branch '3.10':
bpo-32133: Improve numbers docs (GH-26124) (GH-26149)
https://github.com/python/cpython/commit/a38db84122b4f664ee30b9ffd55ce87b7f4517ac


--

___
Python tracker 

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



[issue32133] documentation: numbers module nitpick

2021-05-15 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee: docs@python -> rhettinger
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



[issue44143] The parse crashes when raising tokenizer errors when an existing exception is set

2021-05-15 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 1afaaf5a2dc901377bb17f6fbe0cff7bf3b797e3 by Miss Islington (bot) 
in branch '3.10':
bpo-44143: Fix crash in the parser when raising tokenizer errors with an 
exception set (GH-26144) (GH-26148)
https://github.com/python/cpython/commit/1afaaf5a2dc901377bb17f6fbe0cff7bf3b797e3


--

___
Python tracker 

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



[issue44143] The parse crashes when raising tokenizer errors when an existing exception is set

2021-05-15 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue44136] Remove pathlib flavours

2021-05-15 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> pitrou
nosy: +pitrou

___
Python tracker 

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



[issue44144] Python window not opening

2021-05-15 Thread Chinmay Malvania


New submission from Chinmay Malvania :

Python shell's window not opening and even if it is, it glitches.

--
components: Unicode
messages: 393723
nosy: chinmay.malvania, ezio.melotti, vstinner
priority: normal
severity: normal
status: open
title: Python window not opening
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



[issue44144] Python window not opening

2021-05-15 Thread Chinmay Malvania


Change by Chinmay Malvania :


--
assignee:  -> christian.heimes
components: +SSL -Unicode
nosy: +christian.heimes

___
Python tracker 

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



[issue44144] Python window not opening

2021-05-15 Thread Christian Heimes


Change by Christian Heimes :


--
nosy:  -christian.heimes

___
Python tracker 

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



[issue44123] make function parameter sentinel value true singletons

2021-05-15 Thread Tal Einat


Tal Einat  added the comment:

> And what you need is just to not pass to the wrapped function arguments which 
> were not passed to wrapper. *args and **kwargs do not contain arguments which 
> were not passed.

It's common for wrapper functions to mirror the defaults of the wrapped 
functions and pass those along... A quick search brings up an example from 
dataclasses where sentinel values are passed as arguments to a wrapped 
callable[1].

I concede that issues with pickling such values are very unlikely. I stumbled 
upon such an issue once and it was difficult to debug, but that was a very 
unusual circumstance.

Still, it's a bit surprising that we have public facing values in stdlib 
modules which don't behave as one would expect with regard to pickling. This is 
why I created this 

It seems that I should have marked this as "enhancement" rather than the 
default of "behavior", though, since I meant this to be an improvement on the 
current situation, rather then assert the current situation is "broken".

[1] 
https://github.com/python/cpython/blob/c10c2ec7a0e06975e8010c56c9c3270f8ea322ec/Lib/dataclasses.py#L346

--
type: behavior -> enhancement
versions:  -Python 3.10

___
Python tracker 

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



[issue44144] Python window not opening

2021-05-15 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

How are you trying to start the shell? Does "shell window" mean IDLE? What 
operating system are you using? What do you mean by "it glitches"?

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue37373] Configuration of windows event loop for libraries

2021-05-15 Thread Ben Darnell


Ben Darnell  added the comment:

> It's even slightly easier for tornado, which can reasonably set the 
> proactor-wrapper policy at IOLoop start time, which means 
> `asyncio.get_event_loop()` returns a loop with add_reader. But pyzmq doesn't 
> get invoked until an event loop is already running.

That's not what I'm doing in Tornado; I don't change the policy or the result 
of get_event_loop. Instead, I call get_event_loop (only once) and wrap its 
result in AddThreadSelectorEventLoop. This works even while the event loop is 
already running (which is not an uncommon case; there is no expectation that 
you use tornado.ioloop.IOLoop.start instead of asyncio.EventLoop.run_forever). 

This relies on the fact that I already have my own thread-local lookup function 
to retrieve the wrapped event loop; an application that used the more typical 
asyncio patterns and relied on get_event_loop would indeed have difficulty with 
this pattern.

--

___
Python tracker 

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



[issue10513] sqlite3.InterfaceError after commit

2021-05-15 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Closing as fixed. If someone disagrees; please re-open.

--
resolution:  -> fixed
status: pending -> closed

___
Python tracker 

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



[issue24964] Add tunnel CONNECT response headers to httplib / http.client

2021-05-15 Thread Alexey Namyotkin


Change by Alexey Namyotkin :


--
pull_requests: +24786
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/26152

___
Python tracker 

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



[issue13498] os.makedirs exist_ok documentation is incorrect, as is some of the behavior

2021-05-15 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

This issue was really two issues: fix doc of existing behavior; change behavior 
(which would be an enhancement).  The first has been done; the second not.  I 
think this should be closed and if anyone still proposes the second, open a new 
enhancement issue for 3.11, referencing this one, that clearly lays out the 
proposed change and rationale, given the 3.10 status quo.  (I have no opinion 
about the proposed change.)

Once someone submits a patch, we are free to change it before or after applying 
it.  But before, we give the author first crack and wait a week or so for an 
answer.

Hynek, do you still propose the change in your second patch?  If so, do you 
want to update it and make a PR?

--

___
Python tracker 

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



[issue24964] Add tunnel CONNECT response headers to httplib / http.client

2021-05-15 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions: +Python 3.11 -Python 3.6

___
Python tracker 

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



[issue24964] Add tunnel CONNECT response headers to httplib / http.client

2021-05-15 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Alexey, to repeat what I said to Thomas above: please sign a contributor 
agreement for your patches to be considered.
https://www.python.org/psf/contrib/
https://www.python.org/psf/contrib/contrib-form/

--

___
Python tracker 

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



[issue24964] Add tunnel CONNECT response headers to httplib / http.client

2021-05-15 Thread Alexey Namyotkin


Alexey Namyotkin  added the comment:

Thanks, Terry. I signed it.

--

___
Python tracker 

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



[issue29688] Add support for Path.absolute()

2021-05-15 Thread Barney Gale


Change by Barney Gale :


--
keywords: +patch
nosy: +barneygale
nosy_count: 8.0 -> 9.0
pull_requests: +24787
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26153

___
Python tracker 

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



[issue43905] dataclasses.astuple does deepcopy on all fields

2021-05-15 Thread Andrei Kulakov


Change by Andrei Kulakov :


--
keywords: +patch
nosy: +andrei.avk
nosy_count: 3.0 -> 4.0
pull_requests: +24788
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26154

___
Python tracker 

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



[issue29688] Add support for Path.absolute()

2021-05-15 Thread Barney Gale


Barney Gale  added the comment:

New PR up here: https://github.com/python/cpython/pull/26153

The correspondence between `pathlib` and `os.path` is as follows:


- `Path.resolve()` is roughly `os.path.realpath()`
- `Path.absolute()` is roughly `os.path.abspath()`

Differences:

- `resolve()` always raises RuntimeError on symlink loops, whereas `realpath()` 
either raises OSError or nothing depending on *strict*.
- `absolute()` doesn't normalize the path, whereas `abspath()` does. 
Normalizing without resolving symlinks can change the meaning of the path, so 
pathlib does the better thing here.

--

___
Python tracker 

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



[issue39950] Add pathlib.Path.hardlink_to()

2021-05-15 Thread Barney Gale


Change by Barney Gale :


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



[issue39924] pathlib handles missing `os.link`, `os.symlink` and `os.readlink` inconsistently

2021-05-15 Thread Barney Gale


Change by Barney Gale :


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



[issue39950] Add pathlib.Path.hardlink_to()

2021-05-15 Thread Barney Gale


Change by Barney Gale :


--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue39950] Add pathlib.Path.hardlink_to()

2021-05-15 Thread Barney Gale


Change by Barney Gale :


--
pull_requests: +24789
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/26155

___
Python tracker 

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



[issue44144] Python window not opening

2021-05-15 Thread Chinmay Malvania


Chinmay Malvania  added the comment:

Never mind I just had to restart my PC

On Sat, May 15, 2021 at 3:28 PM Dennis Sweeney 
wrote:

>
> Dennis Sweeney  added the comment:
>
> How are you trying to start the shell? Does "shell window" mean IDLE? What
> operating system are you using? What do you mean by "it glitches"?
>
> --
> nosy: +Dennis Sweeney
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue44142] ast.unparse: visually better code generation

2021-05-15 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


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

___
Python tracker 

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



[issue44145] hmac.update is not releasing the GIL when openssl's hmac is used

2021-05-15 Thread Gregory P. Smith


New submission from Gregory P. Smith :

This prevents parallel hmac computations.

see michaelforney's comment left on https://github.com/python/cpython/pull/20129
where the problem was introduced when adding support for using OpenSSL's HMAC 
implementations.

easy fix.  PR coming.

We don't really have a way to unittest for regressions on things like this.

--
assignee: gregory.p.smith
components: Extension Modules
keywords: 3.9regression
messages: 393733
nosy: christian.heimes, gregory.p.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: hmac.update is not releasing the GIL when openssl's hmac is used
type: performance
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